Goppa code

In mathematics, an algebraic geometric code (AG-code), otherwise known as a Goppa code, is a general type of linear code constructed by using an algebraic curve formula_1 over a finite field formula_2. Such codes were introduced by Valerii Denisovich Goppa. In particular cases, they can have interesting extremal properties. They should not be confused with binary Goppa codes that are used, for instance, in the McEliece cryptosystem.
Construction.
Traditionally, an AG-code is constructed from a non-singular projective curve X over a finite field formula_2 by using a number of fixed distinct formula_2-rational points on formula_5:
Let formula_7 be a divisor on X, with a support that consists of only rational points and that is disjoint from the formula_8. Thus formula_9
By the Riemann–Roch theorem, there is a unique finite-dimensional vector space, formula_10, with respect to the divisor formula_7. The vector space is a subspace of the function field of X.
There are two main types of AG-codes that can be constructed using the above information.
Function code.
The function code (or dual code) with respect to a curve X, a divisor formula_7 and the set formula_13 is constructed as follows.
Let formula_14, be a divisor, with the formula_8 defined as above. We usually denote a Goppa code by C(D,G). We now know all we need to define the Goppa code:
For a fixed basis formula_17 for "L"("G") over formula_2, the corresponding Goppa code in formula_19 is spanned over formula_2 by the vectors
Therefore, 
is a generator matrix for formula_23
Equivalently, it is defined as the image of
The following shows how the parameters of the code relate to classical parameters of linear systems of divisors "D" on "C" (cf. Riemann–Roch theorem for more). The notation "ℓ"("D") means the dimension of "L"("D").
Proof. Since formula_27 we must show that
Let formula_29 then formula_30 so formula_31. Thus, formula_32 Conversely, suppose formula_33 then formula_34 since
("G" doesn't “fix” the problems with the formula_36, so "f" must do that instead.) It follows that formula_37
Proof. Suppose the Hamming weight of formula_39 is "d". That means that for formula_40 indices formula_41 we haveformula_42 for formula_43 Then formula_44, and
Taking degrees on both sides and noting that
we get
so
Residue code.
The residue code can be defined as the dual of the function code, or as the residue of some functions at the formula_8's.