# Proving well-definedness of “valuation of $f$ at $p$”?

Let $X$ be an irreducible variety, $p \in X$. Define $\mathcal{O}_{X,p}$ and $\mathcal{m}_{X,p}$ as usual. We have the following theorem: $\mathcal{m}_{X,p} = (\pi)$ is a principal ideal and $\bigcap _{n \geq 0 } \mathcal{m}_{X,p}^n = \{ 0 \}$.

I'm trying to understand the proof of the following: Every $f \in k(X)^\times$ can be written uniquely $f = \pi^n u$, with $n \in \mathbb Z$, $u \in \mathcal{O}_{X,p}^\times$.

The proof I have proceeds as follows: As $\bigcap \mathcal{m}_{X,p}^n = 0$, given $f \in \mathcal{O}_{X,p}$ there exists a unique $n \geq 0$ such that $f \in \mathcal{m}_{X,p}^n \backslash \mathcal{m}_{X,p}^{n+1}$. Why is this true? I feel like it's something obvious and that I'm just being slow.

Thanks!

-
What is $O_{X,p}$ and $m_{X,p}$? –  La Belle Noiseuse May 18 '12 at 8:42

Note that $$\bigcap_{n=0}^\infty m_{X,p}^n=\{0\}$$ implies that for any non-zero $f\in\mathcal{O}_{X,p}$, there is some $n$ for which $f\notin m_{X,p}^n$. Thus, by the well-ordering of the non-negative integers, there is a least such $n$, call it $n_0$. Note that $n_0>0$, because $f\in \mathcal{O}_{X,p}=m_{X,p}^0$. We therefore have $$f\notin m_{X,p}^{n_0},\quad f\in m_{X,p}^{n_0-1}$$ and thus $$f\in m_{X,p}^{n_0-1}\setminus m_{X,p}^{n_0}.$$ You can also think of the result that any non-zero $f\in k(X)^\times$ can be written uniquely as $f=\pi^nu$ for some $n\in\mathbb{Z}$ and $u\in\mathcal{O}_{X,p}^\times$ as just being the consequence of unique prime factorization in the DVR $\mathcal{O}_{X,p}$, there being only one irreducible element up to associates, namely $\pi$.