As is well known, Lagrangian mechanics have been entirely geometrized in te
rms of symplectic geometry. On the other hand, the geometrization of non-ho
lonomic mechanics has been less developed. However, due to the interest aro
used by non-holonomic geometry, many papers have been devoted to this subje
ct. In this article we generalize the construction of a connection whose ge
odesics are the trajectories of a system, obtained by Vershik and Feddeef i
n the case where the Lagrangian is quadratic and the constraints are linear
on the velocities. Using the algebraic formalism of the connections theory
introduced by the first author, we carry out the construction in the gener
al case of an arbitrary mechanical system (i.e. of a manifold with a convex
Lagrangian not necessarily homogeneous) with ideal non-holonomic constrain
ts. Moreover, we prove something stronger than the result of Vershik and Fe
ddeev: our connection has not only the above-mentioned property for the geo
desics, but it preserves the Hamiltonian by parallel transport. This connec
tion is then a generalization of the Levi-Civita connection for the Riemann
ian manifolds for which the metric (i.e. the kinetic energy) is preserved b
y parallel transport. (C) 1999 Elsevier Science B.V. All rights reserved.