On the Conditions for Domain Stability for Machine Learning: a Mathematical Approach