dimension of space of modular functions using the Riemann-Roch theorem? Let $H$ be the upper half-plane, and $M_k$ be the space of modular forms of weight $k$ on $H$ under the action of $SL(2,\mathbb{Z})$. 
I have read (Koblitz, Introduction to Elliptic Curves and Modular forms) a computational approach to determining the dimension of $M_k$. 
However, in multiple sources, it has claimed that one can compute these dimensions easily using the Riemann-Roch theorem. After reading the Riemann-Roch theorem (from Otto Forster's Lectures on Riemann Surfaces) I am no closer to understanding how this is done. This probably means I haven't really understood the theorem, but could someone please illustrate how it helps in finding $dim(M_k)$?
 A: First of all you speak about $M_k$ but only even $k$'s matter, as $M_k = 0$ for odd $k$. So I will look at $M_{2k}$.
Compactify $H$ with one point at infinity in $\overline{H}$, note $G = SL(2,\mathbb{Z})$, and consider the quotient left quotient $X = {}_{G\backslash} \overline{H}$. This is a compact Riemann surface, and any modular form $f$ of weight $2k$ invariant by the action of $G$ descends to an holomorphic function on $X$. Take such a non-zero $f$. Now note $z_1,\ldots,z_n$ the zeros of $f$ and $k_1,\ldots,k_n$ their respective ordres. (You should take care properly of how you defined the order of a zero here, as some points like $i$ for instance may have non trivial stabilizer's. If $z_i$ is such a point, $k_i$ should by replaced by its product by the order of the stabilizer.)
Now, let state something weaker than Riemann-Roch that will suffice to conclude that $M_{2k}$ is of finite dimension :
Theorem. Let $Z$ be a compact Riemann surface. Let $z_1,\ldots,z_n\in Y$ and (positive integers) $k_1,\ldots,k_n$. Let $M$ be the vector space of
meromorphic functions on $Y$ which are holomorphic except possibly at the the $z_i$'s where at a $z_i$ the situation is the following : they are either holomorphic or they have a pole of order $\leq k_i$. Then $M$ is of finite dimension $\leq k_1+\ldots+k_n +1$.
Proof. Take $z$ a coordinate around a $z_i$, then any element $f$ of $M$ has a Laurent expansion around $z_i$ of the form $$f(z) = a_{-k_i} z^{-k_i} + a_{-k_i+1} z^{-k_i+1} + \ldots$$ For each $i$ take all coefficents of negative indices. You have a total of $k = \leq k_1+\ldots+k_n$ such elements that gives you an element $\varphi(f)\in\mathbf{C}^k$. The map $\varphi : M\to \mathbf{C}^k$ is obviously linear. Now take $f_1,\ldots,f_l \in M$ with $l>k$. Then by a dimension argument you can find $\lambda_1,\ldots,\lambda_l\in\mathbf{C}$, not all zero, such that $$\lambda_1 \varphi(f_i) + \ldots + \lambda_l \varphi(f_l) = 0.$$ Then $g = \lambda_1 f_i + \ldots + \lambda_l f_l$ has no poles and is, by the maximum modulus principle, constant. This implies that the dimension of $M$ is $\leq k+1$. $\square$
Now going back to our modular form $f$. If $g\in M_{2k}$ then $\frac{g}{f}$ is a weakly modular form of weight $0$. Take $M$ to be the space associated thx to the theorem to our situation given by $f$. Then we see that $g\mapsto\frac{g}{f}$ is an isomorphism $M_{2k} \to M$, showing that $M_{2k}$ is finite dimensional, of dimension $\leq k_1+\ldots+k_n +1$.
To explicitely calculate the dimension, you will indeed need full Riemann-Roch, and you can have all details in this note :
http://www2.math.ou.edu/~kmartin/mfs/ch5.pdf
You will see, it is not hard, just technical. The result is the following : $$\textrm{dim}_{\mathbf{C}} M_k = \left\{ \begin{array}{cll} 0 & \textrm{if} & k\textrm{ is odd} \\
\left[ \frac{k}{24} \right] & \textrm{if} & k\textrm{ is even and }\textrm{if} & \frac{k}{2} = 2 \textrm{ mod } 12 \\
\left[ \frac{k}{24} \right] + 1 & \textrm{if} & k\textrm{ is even and }\textrm{if} & \frac{k}{2} \not= 2 \textrm{ mod } 12 \\\end{array}
\right.$$ where $[x]$ is the floor part of $x$.
