Suppose we have a Lie algebra $\mathfrak{g}$ with basis $\{e_1, \ldots, e_n\}$ and dual basis $\{\theta^1, \ldots, \theta^n\}$. Further suppose that $\mathfrak{h}\subset \mathfrak{g}$ is a codimension $\ell$ subspace given by $\mathfrak{h} = \text{span}\{\omega^1, \ldots, \omega^\ell\}^\perp$. Does the condition $d\omega^i \equiv 0 \mod \{\omega^1, \ldots, \omega^\ell\}$ imply that $\mathfrak{h}$ is a subalgebra of $\mathfrak{g}$?
In particular, if $\mathfrak{h} = \text{span}\{\omega\}^\perp$, does $d\omega \wedge \omega = 0$ guarantee that $\mathfrak{h}$ will be a subalgebra?