Given a vector bundle $\pi\colon E \rightarrow B$ equipped with a connection $\nabla$, it is well known that a basis of flat sections $s_i$ ($i=1,\dots,\text{rank}(E)$) (i.e. $\nabla_X s_i = 0$ for all vector fields $X \in \Gamma(TB)$) locally exists if and only if the corresponding curvature 2-form $\Omega_\nabla$ vanishes.

I would now like to relax the condition $\nabla s_i = 0$ to hold not necessarily for all tangent vectors but only on a subbundle of $TB$. So given a distribution $\xi \subset TB$, I want to know if there locally exists a basis of sections $s_i$ of $E$ such that $$ \nabla_X s_i = 0 \quad\text{for all}\quad X \in \Gamma(\xi) \,. $$ My guess is that $$ \Omega_\nabla(X,Y) = 0 \quad\text{for all}\quad X,Y \in \Gamma(\xi) $$ is a necessary and sufficient condition. Is this true? And if yes, is there an easy way to see it (e.g. from the above statement)?

Furthermore, I am interested in "non-trivial" solutions. By this I mean the existence of $n = \dim(B) - \dim(\xi)$ local frames $s^{(1)}_i, \dots, s^{(n)}_i$ such that for each $i$ the $\nabla s^{(k)}_i$ are linearly independent (I am not 100% sure if this is the correct way to phrase it...).

Let me illustrate this for the case of a trivial line bundle with trivial connection. Here, the connection is flat and solutions always exists and are given by constant functions. However, if I demand the existence of $n$ independent solutions, the problem is answered by Frobenius' theorem, which requires $\xi$ to be involutive (i.e. $\xi$ must be closed with respect to the Lie bracket). Is it possible to do a similar statement in the general case, i.e. for a non-trivial, non-flat connection?

vectorbundle and acovariant constantsection. Also, note that you don't need your $X$ to be vector fields; vectors will do. Finally the result you quote is not quite right: flatness of the connection is equivalent to the local existence of ${\rm rank}(E)$ linearly independent covariant constant sections. $\endgroup$ – Oliver Nash Jun 20 '18 at 10:31onesection is not enough to deduce the vanishing of the curvature tensor. However, this seems to be in contradiction to Def. 5.1 and Theorem 5.15 of these lecture notes. $\endgroup$ – Severin Jun 20 '18 at 10:47fibrebundles. $\endgroup$ – Severin Jun 20 '18 at 11:42