In algebraic geometry, a closed immersion of schemes is a regular embedding of codimension r if each point x in X has an open affine neighborhood U in Y such that the ideal of is generated by a regular sequence of length r. A regular embedding of codimension one is precisely an effective Cartier divisor.