Genus of a curve: topology vs algebraic geometry In topology one defines the genus  $g$ of a connected  orientable topological manifold $X$ as:

The maximum number $g$ of cuttings along non-intersecting closed simple curves without rendering the resultant manifold disconnected. It is equal to the number of handles on it.

Now, if $X$ is an irreducible curve, Fulton defines the genus of $X$ via the Riemann's theorem:

Here $l(D)$ is the dimension of the vector space $$\mathcal O_X(D)(X)=L(D)=\{f\in K^\ast(=k(X)^\ast)\,:\, div(f)+D\ge 0\}\cup \{0\}$$ over $k$. 
How can I prove that both the definitions of the genus $g$ represent the same thing? In wich way the Fulton's genus represent the "number of holes" of $X$?
 A: One way to explain the connection is via the Hodge decomposition of the (singular) cohomology groups of an algebraic variety.


*

*On one hand, viewing $X$ as a two-dimensional real manifold, and using say Mayer--Vietoris, one proves that $H_1(X,\mathbf{Z}) \cong \mathbf{Z}^{2g}$, and hence by duality, $H^1(X,\mathbf{C}) \cong \mathbf{C}^{2g}$. 

*On the other hand, let's upgrade Riemann's theorem to the Riemann--Roch theorem, which says that if $K$ is the canonical bundle (i.e. the bundle of holomorphic 1-forms) on $X$, then
$$l(D)-l(K-D) = \mathrm{ deg}\, D + 1 -\gamma.$$
(I changed $g$ to $\gamma$ because a priori this isn't the same as the previous $g$; indeed, that's what we want to prove.) Applying this with $D=0$ we get 
$$1-l(K) = 1-\gamma$$
hence $l(K)=\gamma$. Now $l(K)$ by definition means the dimension of the space of global sections of the bundle $K$ of holomorphic 1-forms on $X$. Another notation for the same space is $H^0(X,\Omega^1)$, so we have $\mathrm{dim} \, H^0(X,\Omega^1)=\gamma$. 
The statement of Hodge decomposition for curves is the following: 
\begin{align} 
H^1(X,\mathbf{C}) = H^0(X,\Omega^1) \oplus H^1(X,\mathcal{O}_X) \end{align}
and moreover the two direct summands on the right-hand side are conjugate, hence have the same dimension $\gamma$. (Don't worry about what $H^1(\mathcal{O}_X)$ actually is if you don't know the definition of sheaf cohomology; all that matters is that it has dimension $\gamma$.)
Now we know the dimensions of both sides of the displayed formula from 1. and 2. above, and plugging them in we get 
$$2g=\gamma+\gamma;$$ 
that is, $g=\gamma$! 
Edit: Maybe it's worthwhile mentioning a simpler proof for plane curves of the equality of these two numbers. 
First of all, it's easy to deduce from the Riemann–Roch theorem that the degree of the canonical line bundle $K$ is 
$$\text{deg} \, K = 2\gamma - 2.$$
On the other hand, if $X$ is a smooth curve of degree $d$ in $\mathbf{P}^2$, one can write down an explicit nonzero regular differential $\omega$ on $X$, and observe that it has $d(d-3)$ zeroes. Since $\omega$ is a section of $K$, this shows that 
$$\text{deg} \, K = d(d-3).$$
Comparing these two expressions for the degree, we find that $\gamma=\frac12 (d-1)(d-2)$. 
So our goal is now to show that the topological genus $g(X)$ is also equal to $\frac12 (d-1)(d-2)$. To do this, we use the fact that $X$ is a degree-$d$ branched cover of $\mathbf P^1$ with $d(d-1)$ ramification points (to see this, project from a general point in $\mathbf P^2$). This gives the formula
$$\chi(X) = 2d -d(d-1);$$
since $\chi(X)=2-2g$, this simplifies to give $g=\frac12 (d-1)(d-2)$, as required.
A: According to Wikipedia, you need the curve $X$ to be non-singular if you want the complex and algebraic genus to agree. Moreover, the definitions are unified by taking $X$ over the base field $\mathbb{C}$ and taking the topological genus of the resulting complex curve, i.e. surface of real dimension two. 
I would suggest you look at the Riemann-Roch Theorem which gives a statement similar to the theorem you gave, but in terms of an equality. The proof of which involves some very hard maths.
