  Motivated by the recent measurements of Kondo resistivity in thin films and
wires, where the Kondo amplitude is suppressed for thinner samples, the surface
anisotropy for magnetic impurities is studied. That anisotropy is developed in
those cases where in addition to the exchange interaction with the impurity
there is strong spin-orbit interaction for conduction electrons around the
impurity in the ballistic region. The asymmetry in the neighborhood of the
magnetic impurity exhibits the anisotropy axis $n$ which, in the case of a
plane surface, is perpendicular to the surface. The anisotropy energy is
$\Delta E=K_d (nS)^2$ for spin $S$, and the anisotropy constant $K_d$ is
inversionally proportional to distance $d$ measured from the surface and
$K_d>0$. Thus at low temperature the spin is frozen in a singlet or doublet of
lowest energy. The influence of that anisotropy on the electrical resistivity
is the subject of the following paper (part II).
