A Theory of Stable Market Segmentations