  We prove a family of new Weitzenb\"ock formulas on a Riemannian foliation
with totally geodesic leaves. These Weitzenb\"ock formulas are naturally
parametrized by the canonical variation of the metric. As a consequence, under
natural geometric conditions, the horizontal Laplacian satisfies a generalized
curvature dimension inequality. Among other things, this curvature dimension
inequality implies Li-Yau estimates for positive solutions of the horizontal
heat equation and a sub-Riemannian Bonnet-Myers compactness theorem whose
assumptions only rely on the intrinsic geometry of the horizontal distribution.
