Gradient bounds for the horizontal p-Laplacian on a Carnot group and some applications