Intersection multiplicity does not go down after restriction to closed subvariety: proof using filtrations Let $S$ be a noetherian domain, and $f\in S$ neither a unit nor a zero divisor. Let $P$ be a minimal prime over $f$, let $I\subset S$ be a prime ideal, suppose the image of $f$ in $S/I$ is neither a unit nor a zero-divisor, and let $Q$ be a minimal prime over $S/(I+f)$ containing $P$. I'm looking to verify that $\operatorname{length}_{S_P} S_P/(f)\leq \operatorname{length}_{S_Q} S_Q/(I+f)$. This is basically the statement that if $V\subset W$ are two varieties which both intersect a hypersurface $H$ properly, the intersection multiplicity of $V\cap H$ along any component $V'$ of $V\cap H$ is at least as large as the intersection multiplicity of $W\cap H$ along an irreducible component $W'$ of $W\cap H$ containing $V'$. I'm looking to prove this before saying something about it in my lecture when covering material related to Hartshorne I.7, but I'm having trouble finishing the argument.
The main tool that comes to mind is the fact that any finitely generated module over a noetherian ring $R$ has a finite filtration by submodules $M_i$ so that the subquotients $M_{i+1}/M_i$ are isomorphic to $R/\mathfrak{p}_i$ for $\mathfrak{p}_i$ a prime ideal of $R$, and the number of times a minimal prime shows up is the length of the module over that minimal prime. Unfortunately, I am a little rusty in this area and I can't quite finish the argument about how the filtrations of $S/(f)$ and $S/(I+f)$ relate to each other. It seems clear that I should take a filtration of one and either push it forward or pull it back along the obvious map $S/(f)\to S/(I+f)$ and argue from there, but I have had no further success.
One attempt: Localizing at $Q$, we get a finite filtration $\{M_i\}$ of $S_Q/(f)$ with subquotients $(S/\mathfrak{p}_i)_Q$ for $P\subset \mathfrak{p}_i\subset Q$. Under the quotient map $\alpha:S_Q/f\to S_Q/(I+f)$, we have that $\{\alpha(M_i)\}$ form a filtration of $S_Q/(I+f)$, and $M_{i+1}/M_i=S_Q/\mathfrak{p}_i$ surjects on to $\alpha(M_{i+1})/\alpha(M_i)$. If this latter module is nonzero, we're done - it has length at least one, so $\operatorname{length}_{S_Q} S_Q/(I+f)$ is at least the number of terms in the filtration of $S_Q/(f)$, which is at most the number of times $S_Q/P$ appears in that filtration. But I've been getting turned around in why this ought to be the case for a while, and I could use some help.
I'm looking for some help filling in the details of this argument. Alternate methods and suggestions are also welcome!
 A: I believe the desired result is not true. Let $S=\mathbb{Q}[x,y,z]\big/(xy-z^n)$, with $n\geqslant 2$. For convenience we refer to the coset $p+(xy-z^n)\in S$ as $\bar{p}$, for each $p\in\mathbb{Q}[x,y,z]$. Since $xy-z^n$ is irreducible in $\mathbb{Q}[x,y,z]$, $S$ is a domain. Now, let $f=\bar{x}$ and $P=(\bar{x},\bar{z})$. Note that if a prime ideal of $S$ contains $\bar{x}$, then it also contains $\bar{x}\bar{y}=\bar{z}^n$, and thus must contain $\bar{z}$, whence indeed $P$ is a minimal prime over $f$. Now let $I=(\bar{y},\bar{z})$ and take $Q=(\bar{x},\bar{y},\bar{z})$. Note that $I+(f)=I+P=Q$, so $Q$ is indeed a minimal prime over $I+(f)$ containing $P$. Since $I+(f)<S$ is proper, $f+I$ is not a unit in $S/I$. Also, $x\notin(y,z,xy-z^n)=(y,z)$, so $f=\bar{x}\notin (\bar{y},\bar{z})=I$, so $f+I$ is non-zero in $S/I$ and hence not a zero divisor there either. Thus all the conditions of your problem are satisfied.
However, in $S_P$, we have the chain of ideals $(f)_P=(\bar{x})_P<P_P<S_P,$ which is strictly ascending by the lemma below, and so $\operatorname{length}_{S_P}S_P/(f)_P\geqslant 2.$ On the other hand, in $S_Q$, we have $(I+(f))_Q=(I+P)_Q=Q_Q$, so $\operatorname{length}_{S_Q}S_Q/(I+(f))_Q=1$, and thus this provides a counterexample to your claim.
I'm not entirely sure what the geometric significance of this example is; thoughts would be welcome.

Lemma: If $\bar{x}$ and $P$ are as above, then $(\bar{x})_P\neq P_P$.
Suppose the contrary, so that $(\bar{x})_P=P_P$. Then $\bar{z}\big/1\in(\bar{x})_P$, and so there must be some $\bar{q}\in S\setminus P$ such that $\bar{q}\bar{z}\in(\bar{x})$; in other words, $qz\in(x,xy-z^n)=(x,z^n)$, as elements of $\mathbb{Q}[x,y,z]$. Suppose therefore that $qz=\lambda x+\mu z^n$ for some $\lambda,\mu\in\mathbb{Q}[x,y,z]$. Note that $\lambda x=z(q-\mu z^{n-1})$, and thus, since $\mathbb{Q}[x,y,z]$ is a UFD, $z$ divides $\lambda$; say $\lambda=z\lambda'$. Then we have $q=\lambda'x+\mu z^{n-1}\in (x,z)$, since $n\geqslant 2$, but this means $\bar{q}\in(\bar{x},\bar{z})=P$, a contradiction.
