  Let $M$ be a smooth connected and complete manifold of dimension $n$, and
$\Delta$ be a smooth nonholonomic distribution of rank $m\leq n$ on $M$. We
prove that, if there exists a smooth Riemannian metric on $\Delta$ for which no
nontrivial singular path is minimizing, then there exists a smooth repulsive
stabilizing section of $\Delta$ on $M$. Moreover, in dimension three, the
assumption of the absence of singular minimizing horizontal paths can be
dropped in the Martinet case. The proofs are based on the study, using specific
results of nonsmooth analysis, of an optimal control problem of Bolza type, for
which we prove that the corresponding value function is semiconcave and is a
viscosity solution of a Hamilton-Jacobi equation, and establish fine properties
of optimal trajectories.
