Long-range effects in optimizing the geometry of stereoregular polymers. I. Formalism