Riemann-Roch 10: Residues and Codes
Riemann-Roch notes / X
Residues, duality, and codes
The same divisor spaces that count meromorphic functions become message spaces and dual checks in algebraic geometry codes.
Let \(X\) be a smooth projective geometrically integral curve over \(\mathbb F_q\). In this finite-field setting, \(L(G)\) is a vector space over \(\mathbb F_q\) inside the function field \(\mathbb F_q(X)\). A divisor \(G=\sum_P n_PP\) is a sum over closed points, and its degree is \(\sum_P n_P[\kappa(P):\mathbb F_q]\). Rational points have degree one. Choose distinct rational points
\[P_1,\ldots,P_n\]and a divisor \(G\) whose support avoids them. Evaluation gives a linear map
\[L(G)\longrightarrow \mathbb F_q^n, \qquad f\longmapsto (f(P_1),\ldots,f(P_n)).\]Its image is an algebraic geometry code.
Riemann-Roch enters because it estimates the dimension of \(L(G)\). If \(\deg(G)>2g-2\), then
\[\ell(G)=\deg(G)+1-g.\]If also \(\deg(G)<n\), the evaluation map is injective, so this is the code dimension.
The dual residue picture
Put \(D=P_1+\cdots+P_n\). Differentials satisfying \((\omega)\ge G-D\), together with zero, form a vector space. Map this space to residue vectors:
\[\omega\longmapsto (\operatorname{res}_{P_1}\omega,\ldots,\operatorname{res}_{P_n}\omega).\]For \(f\in L(G)\), the product \(f\omega\) has at most simple poles at the \(P_i\) and no poles elsewhere. The residue theorem therefore gives
\[\sum_{i=1}^n f(P_i)\operatorname{res}_{P_i}(\omega)=0.\]Thus the residue code is orthogonal to the evaluation code. The two kernels give dimensions \(\ell(G)-\ell(G-D)\) and \(\ell(K-G+D)-\ell(K-G)\), respectively: a differential with at most a simple pole has zero residue exactly when it is regular there. Applying Riemann-Roch to \(G\) and \(G-D\) shows that these dimensions sum to \(n\), proving that the codes are dual.
Connection with Goppa codes
Classical Goppa codes are genus zero relatives of this construction. Support points give coordinates; a Goppa polynomial controls poles and parity checks. In higher genus, divisors and Riemann-Roch replace the elementary rational-function count.
Two parameter checks show what this means.
For a Reed-Solomon code, take \(X=\mathbb P^1\) over \(\mathbb F_q\), choose \(n\) finite rational points, and put \(G=(k-1)\infty\). For \(1\le k\le n\),
\[L(G)=\operatorname{span}\{1,z,\ldots,z^{k-1}\},\]so the message dimension is \(k\). This is the genus zero case of the AG-code construction.
For an elliptic curve code, take a curve \(E/\mathbb F_q\), rational evaluation points avoiding \(O\), and \(G=dO\) with \(0<d<n\). Since \(g=1\) and \(K\sim 0\),
\[\ell(G)=d.\]The minimum distance is at least the designed value \(n-d\). Compared with the projective-line example, the same divisor count now carries genus one geometry.
The useful lesson is structural: length comes from chosen rational points, dimension comes from a Riemann-Roch space, and dual checks are naturally expressed through differentials and residues.
