Let $A$ be a commutative ring. Let $f\in A\setminus\{0\}$ and $I\subseteq A$ any ideal. I would like to define the **multiplicity of $f$ at $I$** as
$$\mu_f(I):= \max\{\, d\ge 0 \mid f\in I^d\,\},$$
where $I^0:= A$. In the case where $A$ is Noetherian and either local or an integral domain, the Krull Intersection Theorem (Eisenbud, Corollary 5.4) implies that $\mu_f(I)$ is well-defined. Main scenario: $A$ is the local ring of a locally Noetherian scheme $X$ at some point $P$, $I$ is the corresponding maximal ideal and $f$ is locally representing a Cartier divisor on $X$.

I have only seen this in Hartshorne, Page 388, for surfaces, but I do not see why the definition should be limited to surfaces. In general, I only know the following definition of *geometric* multiplicity, for locally Noetherian schemes $X$ and points $P\in X$ of codimension **one**:
$$\bar\mu_f(P):=\mathrm{length}_{\mathcal O_{X,P}}(\mathcal O_{X,P}/(f))$$
Does this coincide with the above definition? If yes, why is $\bar\mu$ so prominent? After all, $\mu$ is more general.

how(or ratherwhen) it misbehaves, though - most of the time I am dealing with very forgiving kinds of schemes anyway. $\endgroup$