Here is a self contained answer to why Riemann's original theorem as he proved it, before Roch's refinement, is indeed an index statement.
Traditionally, the “index” of a linear operator is the difference between the dimensions of its kernel and cokernel. Computing this difference is usually easier than computing either the kernel or cokernel dimensions alone, hence it is a helpful first step even where one of those dimensions is really wanted. Moreover the index gives an estimate of the kernel dimension. Riemann’sRiemann’s proof of his theorem was to calculate such an index as follows.
Given a divisor D$D$ of r$r$ distinct points on a compact complex Riemann surface X$X$ of genus g, he constructed a basis of the g+r$g+r$ dimensional space W≈C^(r+g)$W \cong \mathbb{C}^{r+g}$ of corresponding differentials of “second kind”, i.e. having at worst principal part const.dz/(z-p)^2$\operatorname{const}.dz/(z-p)^2$ at each point p$p$. SinceSince the space L(D)$L(D)$ of meromorphic functions with at worst simple poles at these points maps with one dimensional kernel into the space W$W$, in order to compute the dimension of L(D)$L(D)$ it suffices to compute the subspace of exact differentials in W$W$, i.e. the kernel of the “period map”, obtained by integrating these differentials over a basis for the 1st homology of X$X$.
Thus he wants to compute the kernel of a linear map from C^(r+g)$\mathbb{C}^{r+g}$ to C^2g, where C = complex numbers$\mathbb{C}^{2g}$. ItIt follows immediately from the rank/nullity theorem that the index of this period map is (r+g)-2g = r-g = deg(D)-g$(r+g)-2g = r-g = \deg(D)-g$. HenceHence this is a lower bound for the kernel, so dimL(D) – 1 ≥ r-g$\dim L(D) – 1 \geq r-g$, i.e. dimL(D) ≥ deg(D) + 1-g$\dim L(D) \geq \deg(D) + 1-g$.
This also implies the modern index form of the theorem as follows. RiemannRiemann knew the period map is injective on holomorphic differentials, so he could, and Roch did, replace it by a normalized period map from C^r$\mathbb{C}^r$ to C^g ≈ H^1(X;C)/H^1(X;K) ≈ H^1(X;O)$\mathbb{C}^g \cong H^1(X;\mathbb{C})/H^1(X; K) \cong H^1(X;\mathcal{O})$. TheThe cokernel of this map is now called H^1(X;D)$H^1(X;D)$, so Riemann’s theorem can be phrased chi(D) = h^0(D)-h^1(D) = deg(D) + 1-g$\chi(D) = h^0(D)-h^1(D) = \deg(D) + 1-g$. SinceSince it takes some work to compute chi(O) = h^0(O)-h^1(O)$\chi(\mathcal{O}) = h^0(\mathcal{O})-h^1(\mathcal{O})$ as 1-g$1-g$, this is actually stronger than the modern sheaf theoretic result that chi(D) – chi(O) = deg(D)$\chi(D) – \chi(\mathcal{O}) = \deg(D)$, which follows immediately from the sheaf sequence 0-->O--O(D)-->O(D)|D-->0$0 \to \mathcal{O} \to \mathcal{O}(D) \to \mathcal{O}(D)|_D \to 0$.
Of course Riemann’s result should be stronger since it contains in addition to the trivial sheaf theoretic linear algebra, also the computation of both the holomorphic genus = h^0(X;K)$= h^0(X; K)$, and the topological genus = (1/2)h^0(X;C)$= (1/2)h^0(X; \mathbb{C})$. ThusThus Riemann’s theorem combines the two modern results: chi(D)-chi(O) = deg(D)$\chi(D) -\chi(\mathcal{O}) = \deg(D)$, and chi(O) = 1-g$\chi(\mathcal{O}) = 1-g$.
Roch’s refinement of the RRT is to compute the cokernel h^1(X;D)$h^1(X;D)$ of Riemann’s period map, which he does of course by making a residue calculation. HeHe obtains that h^1(X;D) = h^0(X;K(-D))$h^1(X;D) = h^0(X;K(-D))$, hence h^0(D)-h^0(K(-D)) = deg(D)+1-g$h^0(D)-h^0(K(-D)) = \deg(D)+1-g$, the full RRT.