Solution (source code)

= Solution

For $\pi:E\to B$, the vertical space at $p\in E$ is $V_pE=\ker(d\pi)_p$. A horizontal subspace is a complementary subspace
$$
T_pE=V_pE\oplus H_pE.
$$
A connection is a smooth choice of such complements, linear with respect to the vector-bundle structure. Equivalently, it is a smooth horizontal distribution as in <horizontal subspace of a vector bundle connection>.