Definition of divisor associated to a meromorphic function Let $X$ be a complex manifold and let $f$ be a meromorphic function defined on it. Let $Div(X)$ be the group of locally finite sum of analytic irreducible hypersurfaxces of $X$.

One would like to define a divisor associated to $f$ as $$\sum_{i \in I} ord(f)|_{V_i}V_i$$ but I really can't see why this sum should be locally finite.
Let $h$ be analytic and non identically zero on a small disk $U = \{ z \in \Bbb{C}^n,|z|&lt; r\}$ and $Hol(U)$ the ring of meromorphic functions on $U$ that are analytic on some neighborhood of $0$.

Look at the set of principal ideals $S = \{ (\alpha) , \alpha \in Hol(U), \alpha(0) = 0\} $ partially ordered by inclusion. Let $v(\alpha)$ be the degree of the first non-zero term in $\alpha$'s power series. $v(\alpha \beta) = v(\alpha)+v(\beta)$.

If $(\alpha) \supsetneq (\beta)$ then $ \beta =\alpha\gamma$ with $\gamma(0) = 0$ so $v(\gamma) \ge 1$ and $v(\beta) \ge v(\alpha)+1$.

Thus the maximal elements of $S$ are well-defined : $ M = \{ (\phi) \in S, \not \exists (\varphi) \in S, (\varphi) \supsetneq (\phi)\}$. 

From there let $h_0 = h$, while $h_j(0) = 0$, pick some $ (\phi_{j+1}) \in M$ such that $(h_j) \subset (\phi_{j+1})$ and let $h_{j+1} = \frac{h_j}{\phi_{j+1}}$. Since $v(h)$ is finite the process terminates obtaining the factorization $$\forall z \in U, \qquad h(z) = h_J(z)\prod_{j=1}^J \phi_j(z)$$ where $J \le v(h)$ and $h_J(0) \ne 0$.


  Todo : show $v(\phi_j) = 1$ so $J = v(h)$.


Find an even smaller disk $V$ where $h_J$ is non-zero and the $\phi_J$ are holomorphic. The local divisor is  defined as $Div(h|_V) = \sum_{j=1}^J Z(\phi_j|_V)$ where $Z(\phi|_V) = \{ z \in V, \phi(z)=0\}$.

If $f$ is meromorphic then $f = \frac{h}{g}$ with $g,h$ holomorphic and $Div(f|_V) = Div(h|_V)-Div(g|_V)$.

The global divisor is obtained by gluing those local divisors.
There is an open set $U$ on which your meromorphic function doesn’t have any zeros or poles, so the only nonzero coefficients come from prime divisors on the complement of $U$ in $X$. This complement is a closed set $Z$. Now for the local finiteness: Take the intersection of $Z$ with a quasicompact open set of $X$, which is Noetherian as a topological space because $X$ is locally Noetherian, as it is a complex manifold and the ring of analytic functions in finitely many variables is Noetherian. (I learned this last fact from Huybrechts’s book Complex Geometry). Every subspace of a Noetherian topological space is Noetherian, so in particular this intersection can have only finitely many irreducible components. This gives you local finiteness.