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.



The notion of multiplicity in algebraic geometry
In addition to two good answers, maybe one case the question has a positive answer is when $(R,m)$ is a regular local ring and $f$ is a nonzero element. For a Noetherian local ring $A$ and ideal $I$ which is primary to the maximal ideal, let $e(I, A)$ denote the Hilbert-Samuel multiplicity of $A$ with respect $I$. Then $e(m/(f),R/(f)) = \hbox{ord} (f) e(m, R) = \hbox{ord} (f)$ where $\hbox{ord} (f) = \sup \{ i \mid f \in m^i \}$. Here $e(m, R) = 1$ since $R$ is a regular local ring.


The special case is when the dimension of a ring (not necessarily regular) $R$ is $1$ and $f$ is a non zero-divisor (but not a unit) of $R$. Assume that $R$ is Cohen-Macaulay (domain or reduced implies Cohen-Macaulyness in dim $1$). Then we have that length $(R/(f)) = e((f), R) \ge \hbox{ord} (f) e(m,R)$ where the last inequality follows from Theorem 14.10 in Matsumura's commutative ring theory. A positive answer to your question implies an equality in the formula and $e(m,R) = 1$. The latter condition is equivalent to $R$ being regular if $R$ is unmixed. Note that the associated graded ring is a polynomial ring over the residue field if a ring is regular. In particular, it is a domain. I believe that once $R$ is a regular local ring, then the equality follows.


I believe in Hartshorne's algebraic geometry book, a surface is a nonsingular (locally regular) projective surface over an algebraically closed field. This probably is a reason why it works well. I hope someone can add some geometric point of view. 


