Riemann-Roch notes / XIII

Application II: Goppa codes

Classical Goppa parity checks are the genus zero shadow of the same Riemann-Roch spaces used in algebraic geometry codes.

Goppa codes are a coding-theoretic place where the same divisor language becomes computational. The classical construction lives on the projective line, but it is best understood as part of the same family as algebraic geometry codes.

Let \(L=(\alpha_1,\ldots,\alpha_n)\) be an ordered list of distinct elements of \(\mathbb F_{q^m}\), and let \(g(x)\in\mathbb F_{q^m}[x]\) have degree \(r\), where \(1\le r<n\) and \(g(\alpha_i)\ne0\) for every \(i\). The classical Goppa code over \(\mathbb F_q\) is

\[\Gamma(L,g)=\left\{c\in\mathbb F_q^n: \sum_{i=1}^n \frac{c_i}{x-\alpha_i}\equiv 0 \pmod{g(x)}\right\}.\]

Each denominator is invertible in \(\mathbb F_{q^m}[x]/(g)\) because \(g(\alpha_i)\ne0\), so the congruence is well-defined. Equivalently, the code satisfies the parity checks

\[H_{j,i}=\frac{\alpha_i^j}{g(\alpha_i)}, \qquad 0\le j<r.\]

To verify this equivalence, work in the quotient ring and use

\[\frac1{x-\alpha_i}\equiv -\frac{g(x)-g(\alpha_i)}{(x-\alpha_i)g(\alpha_i)}\pmod{g(x)}.\]

The quotient \((g(x)-g(\alpha_i))/(x-\alpha_i)\) is a polynomial of degree \(r-1\). Reading its coefficients from highest to lowest turns the congruence into an invertible triangular combination of the checks \(\sum_i c_i\alpha_i^j/g(\alpha_i)=0\); the diagonal coefficient is the nonzero leading coefficient of \(g\).

Where Riemann-Roch is hiding

On \(\mathbb P^1\), the space

\[L((r-1)\infty)=\operatorname{span}\{1,x,\ldots,x^{r-1}\}\]

has dimension \(r\) by Riemann-Roch. The rows of the parity-check matrix are evaluations of this basis, twisted by the multipliers \(1/g(\alpha_i)\). The row space is a generalized Reed-Solomon code over \(\mathbb F_{q^m}\). The Goppa code consists of the vectors over the subfield \(\mathbb F_q\) orthogonal to that row space; this subfield restriction is part of the classical construction.

The same pattern generalizes: choose rational points for coordinates, choose a divisor controlling allowed poles, and use Riemann-Roch to estimate the dimension of the function space or its dual differential space.

Why the binary square-free bound is stronger

Suppose the code is binary and \(g\) is square-free. For a nonzero codeword \(c\) of weight \(w\), put \(h(x)=\sum_i c_i/(x-\alpha_i)\). In characteristic two, \(c_i^2=c_i\) gives

\[h'(x)=h(x)^2.\]

The Goppa condition writes \(h=gu\), with \(u\) having no pole at any root of \(g\). Differentiating and reducing modulo \(g\) gives \(g'u\equiv0\pmod g\). Since \(\gcd(g,g')=1\), this implies \(g\mid u\) and hence \(g^2\mid h\). The partial-fraction denominator is the product of the \(w\) factors at nonzero coordinates of \(c\) and is coprime to \(g\). The numerator is nonzero because \(h\) has those nonzero residues, and its degree is at most \(w-1\). Therefore

\[2\deg g\le w-1,\qquad w\ge2r+1.\]

This proves the distance bound used in the two binary examples below.

Two concrete Goppa-code checks

Binary degree-two example

Take \(\mathbb F_8/\mathbb F_2\) and let

\[g(x)=x^2+x+1.\]

Since \(\mathbb F_8^*\) has order \(7\), this polynomial has no root in \(\mathbb F_8\). One may take support \(L=\mathbb F_8\). The parity-check matrix over \(\mathbb F_8\) has two rows,

\[H_{0,i}=\frac{1}{g(\alpha_i)}, \qquad H_{1,i}=\frac{\alpha_i}{g(\alpha_i)}.\]

Over \(\mathbb F_2\) this expands to at most \(2\cdot 3=6\) binary parity-check rows. Hence the standard dimension bound gives

\[k\ge n-mr=8-3\cdot 2=2.\]

Because \(g\) is square-free, the binary square-free Goppa bound gives minimum distance at least \(2r+1=5\).

What changes for degree three

Over \(\mathbb F_{16}/\mathbb F_2\), choose a square-free cubic \(g(x)\) and support points avoiding its roots. Then \(r=3\) and the parity checks use

\[1,x,x^2\in L(2\infty).\]

The binary dimension bound becomes

\[k\ge n-4\cdot 3=n-12,\]

and the binary square-free Goppa bound gives weight at least \(7\) for every nonzero codeword. Thus a nonzero code has minimum distance at least \(7\). The calculation is still a Riemann-Roch count on \(\mathbb P^1\): degree \(2\) at infinity gives a three-dimensional check space.

What the divisor construction contributes

Riemann-Roch controls the dimensions of the spaces from which evaluation codes and residue checks are built. Classical Goppa codes package the genus zero case into a very efficient parity-check form. Algebraic geometry codes keep the same logic but replace \(\mathbb P^1\) by higher genus curves, where the genus term in Riemann-Roch changes the parameters.