Consider the following differential one form on the torus $\mathbb{R}^3/\mathbb{Z}^3$ : $\alpha = dz - \sin(2\pi y) dx$.
Consider the torus as the product manifold $\mathbb{T}^{3} \cong \mathbb{T}^2 \times \mathbb{S}^1$ and let $\pi$ denote the projection $(x,y,z) \mapsto (x,y)$ (the projection onto the first two coordinates). With this projection the torus has a (trivial) fiber bundle structure, and in particular, we can define an Ehresmann connection on it. Let $\mathbb{T}^3 = \mathbb{T}^2\times \mathbb{S}^1$, and let $(m,n)$ represent an ordered pair in this set. Then $\pi: \mathbb{T}^3 \to \mathbb{T}^2$ is given by $\pi(m,n) = m$ and the Vertical subspaces of $T(\mathbb{T}^3)$ are simply given by $V_{(m,n)} = \{m\} \times T_n\mathbb{S^1}$.
I would like to show a couple of things using $\alpha$. First, I would like to show that $\ker \alpha$ defines a connection on this bundle. This amounts to showing that for every $(m,n) \in \mathbb{T}^3$, we have that: $$ T_{(m,n)}\mathbb{T}^3 =\ker \alpha_{(m,n)} \oplus V_{(m,n)} $$ Intuitively, this makes sense - $\alpha$ is a linear functional at each point, so it has a two dimensional kernel. We can write down the kernel of $\alpha$ in terms of the coordinates of the tangent space $T_{(m,n)} \mathbb{T}^3$ at every point. But I'm not sure how to show that this, direct summed with the above vertical subspace, spans the whole space. All I can really say is that one is 2d, the other is 1-d and ergo they direct sum to something that is 3d, but I'm having issues ironing out the specifics.
Second, I'd like to show that the connection defined by this one-form is not flat. There are a variety of equivalent ways of showing this, however, there are two ways in particular I'm interested in. The first is to find vector fields $X_{(m,n)},Y_{(m,n)}$ that span $H_{(m,n)}$ at each point, but whose bracket $[X,Y]$ is not an element of $H$. The second is to show that $\alpha \wedge d \alpha \not = 0$. What is the connection between these two methods?
First, note that $\alpha(\partial/\partial z) \ne 0$, so $\ker\alpha$ does not contain the vertical space. The direct sum follows (by elementary linear algebra).
Second, the "connection" between the two computations you mention is the famous formula $$d\alpha(X,Y) = X(\alpha(Y)) - Y(\alpha(X)) - \alpha([X,Y]).$$ If you have vector fields $X,Y$ with $\alpha(X) = \alpha(Y) = 0$, then $d\alpha(X,Y) = 0$ if and only if $\alpha([X,Y]) = 0$. But $\alpha\wedge d\alpha = 0$ (and $\alpha$ nowhere zero) means that $d\alpha = \alpha\wedge\beta$ for some $1$-form $\beta$, in which case $d\alpha(X,Y) = 0$ whenever $\alpha(X)=\alpha(Y) = 0$.