Qing gives the following definition.
Definition 6.3.4. Let $f:X\rightarrow Y$ be an immersion of locally Noetherian schemes. We say $f$ is a regular immersion of codimension $n$ at $x$ if the ideal $Ker(\mathcal O_{Y,f(x)}\rightarrow \mathcal O_{X,x})$ is generated by a regular sequence of $n$ element.
I'm wondering if it is well defined. For example, is that possible for some other regular sequence generating the ideal, it has a different length?
Also, under this definition, how to show a composition of 2 regular immersions of codimension $n$ and $m$ is still a regular immersion of dimension $n+m$?
Thank you!