Regular points on an effective Cartier divisor is regular on the whole scheme? I think this should be an easy question to answer but I'm being unable to prove it. Vakil, in one of his notes, states that

Suppose $X$ is a finite type $k$-scheme (such as a variety), and $D$ is an effective Cartier divisor on $X$ (Definition 8.4.1), and $p \in X$. Show that if $p$ is a regular point of $D$ then $p$ is a regular point of $X$. (Hint: Krull’s Principal Ideal Theorem for tangent spaces, Exercise 12.1.B.)

Does anyone know how to prove this? And can anyone provide some intuition behind this?
 A: First of all, you should translate this into algebra:

Given a local noetherian ring $(R,\mathfrak m)$ and $f \in \mathfrak m$ a non-zero divisor, such that
  $R/(f)$ is regular. Then $R$ is regular.

To proof this (with the notation from @Hoot 's comment), let $a=\dim R$ and $b=\dim \mathfrak m /\mathfrak m^2$.
Then we have


*

*$a \leq b$, since this holds for any local ring.

*$a-1 = \dim R/(f)$ by Krull's prinicipal ideal theorem.

*By the assumption, we have $a-1 = \dim (\mathfrak m/(f)) /(\mathfrak m/(f))^2$


To conclude, note that $(\mathfrak m/(f)) /(\mathfrak m/(f))^2=\mathfrak m /(\mathfrak m^2 + (f))$ and this fits into an exact sequence $$0 \to (\mathfrak m^2 + (f))/\mathfrak m^2 \to  \mathfrak m /\mathfrak m^2 \to \mathfrak m /(\mathfrak m^2 + (f)) \to 0,$$
hence $a-1 = b- \dim (\mathfrak m^2 + (f))/\mathfrak m^2 \in \{b,b-1\}$.
Finally, we deduce the desired $a=b$. And a posteriori we get $a-1=b-1$, hence $\dim (\mathfrak m^2 + (f))/\mathfrak m^2=1$. This isn't surprising, since $f \notin \mathfrak m^2$ must hold for $R/(f)$ to be regular.
Furthermore, note that we have not assumed $R$ to be an integral domain, but a posteriori we deduce that $R$ is an integral domain.

More generally, if a point is regular on a complete intersection closed subscheme, then it is regular on the variety itself. The proof is of course obtained by just iterating the divisor case.
