  We prove that dynamical coherence is an open and closed property in the space
of partially hyperbolic diffeomorphisms of $\mathbb{T}^3$ isotopic to Anosov.
Moreover, we prove that strong partially hyperbolic diffeomorphisms of
$\mathbb{T}^3$ are either dynamically coherent or have an invariant
two-dimensional torus which is either contracting or repelling. We develop for
this end some general results on codimension one foliations which may be of
independent interest.
