The Ubiquity of Order Domains for the Construction of Error Control Codes

The order domains are a class of commutative rings introduced by H{\o}holdt, van Lint, and Pellikaan to simplify the theory of error control codes using ideas from algebraic geometry. The definition is largely motivated by the structures utilized in the Berlekamp-Massey-Sakata (BMS) decoding algorithm, with Feng-Rao majority voting for unknown syndromes, applied to one-point geometric Goppa codes constructed from curves. However, order domains are much more general, and O'Sullivan has shown that the BMS algorithm can be applied to decode all codes constructed from order domains by a suitable generalization of Goppa's procedure for curves. In this article we will first discuss the connection between order domains and valuations on function fields over a finite field. Under some mild conditions, we will see that a general projective variety over a finite field has projective models which can be used to construct order domains and Goppa-type codes for which the BMS algorithm is applicable. We will then give a slightly different interpretation of Geil and Pellikaan's extrinsic characterization of order domains via the theory of Gr\"obner bases, and show that their results are related to the existence of toric deformations of varieties. To illustrate the potential usefulness of these observations, we present a series of new explicit examples of order domains associated to varieties with many rational points over finite fields: Hermitian hypersurfaces, Grassmannians, and flag varieties.


Introduction
The notion of an order domain was introduced by Høholdt, van Lint, and Pellikaan in [14] to simplify and extend the theory of error control codes using ideas from algebraic geometry. The definition (see Definition 1 below for the formulation we will use) is largely motivated by the structures utilized in the Berlekamp-Massey-Sakata (BMS) decoding algorithm for one-point geometric Goppa codes constructed from curves, the Feng-Rao bound on the minimum distance for those codes, and the majority voting process for unknown syndromes. All of these coding theoretic constructions are based on the properties of the ring of rational functions with poles only at one smooth F q -rational point Q on a curve, R = ∪ ∞ m=0 L(mQ). These rings are the prototypical examples of order domains, and they furnish all the examples whose fields of fractions have transcendence degree 1 over the field of constants.
Geil and Pellikaan ( [8], [6]) and O'Sullivan ( [17]) have studied the structure of order domains whose fields of fractions have arbitrary transcendence degree. Moreover, O'Sullivan ( [18]) has shown that the Berlekamp-Massey-Sakata decoding algorithm (abbreviated as the BMS algorithm in the following) and the Feng-Rao procedure extend in a natural way to suitable classes of evaluation and dual evaluation codes constructed in this much more general setting. (See also [4], Chapter 10 for an introduction to this topic.) Order domains can be constructed either intrinsically or extrinsically, that is, by means of the algebra of the field K = QF (R), or by means of explicit presentations (e.g. as affine algebras F q [X 1 , . . . , X s ]/I with I of a special form).
From the intrinsic point of view, the most important fact is the observation exploited by O'Sullivan that order functions come from valuations on K. (See [25] or [27], Chapter VI for general discussions of valuations on fields.) This is clear in a sense from the definition (see Definition 1 below). The examples of order domains in function fields of curves also make this transparent. Indeed, let X be a smooth projective curve defined over F q , and let Q be an F q -rational point on X . Then for R = ∪ ∞ m=0 L(mQ), Γ is equal to the Weierstrass semigroup of X at Q (the subsemigroup of Z ≥0 consisting of all pole orders of rational functions on X with poles only at Q), and ρ(f ) = −v Q (f ), where v Q is the discrete valuation at Q on the function field of X .
O'Sullivan extends this valuation-theoretic point of view to the case of function fields of transcendence degree ≥ 2 over F q (function fields of surfaces and higherdimensional varieties) in [17]. He shows that every function field of transcendcence degree 2 contains order domains of several different types, corresponding to some of the possible valuation rings in these fields in a complete classification due originally to Zariski, and reworked in modern language by Spivakovsky (see [26] and [23]).
The valuation-theoretic interpretation of order domains also makes connections with earlier work of Sweedler, [24], Beckman and Stückrad, [3], and work of Mosteig and Sweedler, [16], where filtrations of rings arising from valuations are used as the foundation for a theory of normal forms and generalized Gröbner bases. [17] and [8] also discuss an extension of the theory of Gröbner bases to ideals in order domains.
From the extrinsic point of view, the following result of Geil and Pellikaan is also extremely useful, though it applies only in the case that the value semigroup Γ is finitely generated, hence isomorphic to a sub-semigroup of Z r ≥0 for some r. In the following statement, M is an r × s matrix with entries in Z ≥0 with linearly independent rows. For α ∈ Z s ≥0 (written as a column vector), the matrix product M α is a vector in Z r ≥0 . We will call this the M -weight of the monomial x α . We write M for the subsemigroup of Z r ≥0 generated by the columns of M , ordered by any convenient monomial order ≻ on Z r ≥0 (for instance the lex order as in Robbiano's characterization of monomial orders by weight matrices). We will make use of the monomial orders > M,τ on F q [X 1 , . . . , X s ] defined as follows: X α > M,τ X β if M α ≻ M β, or if M α = M β and X α > τ X β , where τ is another monomial order used to break ties.
(1) Let I ⊂ F q [X 1 , . . . , X s ] be an ideal, and let G be the reduced Gröbner basis for I with respect to a weight order > M,τ as above (abbreviated as > below). Suppose that every element of G has exactly two monomials of highest Mweight in its support, and that the monomials in the complement of LT > (I) (the "standard monomials" or monomials in the "footprint of the ideal") have distinct M -weights. Then R = F q [X 1 , . . . , X s ]/I is an order domain with value semigroup Γ and order function ρ defined as follows: Writing f in R as a linear combination of the monomials in the complement of (2) Every order domain with finitely-generated semigroup Γ = M has a presentation R ∼ = F q [X 1 , . . . , X s ]/I such that the reduced Gröbner basis of I with respect to > M,τ and the standard monomials are as in part 1.
Our main goals in this article are to begin to indicate just how general the order domain construction is, and to show how the intrinsic and extrinsic characterizations of order domains can be used to construct codes from a number of interesting classes of higher-dimensional algebraic varieties.
After some preliminaries on order functions and valuations in §2, we will begin in §3 by proving some general results on the relation between order domains and valuation rings in function fields, along the lines of [16]. We will discuss several types of valuations on general function fields that are suitable for the construction of order domains, extending O'Sullivan's work for the case of the function fields of surfaces from [17]. We will concentrate mainly on identifying the order domains rather than on describing the corresponding valuation rings, as is done in [17].
In rough terms, we will show that the function field of any projective variety X over a finite field F q satisfying some relatively mild conditions (for instance, the existence of a collection of suitable subvarieties of X defined over F q ) contains order domains R of several different types. See Theorems 2 and 3 below for more precise, detailed statements.
We have chosen to concentrate on the cases that lead to order domains with finitely generated value semigroups, since these are the ones likely to be of most interest in coding theory. We note, though, that order domains with value semigroups that are not finitely generated (see [17], §5, and [8], Example 9.6) will also exist in these function fields.
Because of the possibility of blowing up subvarieties in varieties of dimension ≥ 2 (see for instance Chapter II, §7 of [12]), the theory of valuations on function fields of transcendence degree ≥ 2 is necessarily significantly more subtle than in the case of transcendence degree 1. In particular, to describe a certain valuation on the function field of a variety X of dimension ≥ 2, it may be necessary to pass to a blow-up of X . [17] discusses this in detail for valuations related to monomial orders on F q [X, Y ]. In order to keep the prerequisites in birational geometry to a minimum, though, we will concentrate on the case where valuations and order domains can be described directly from a given projective model X , without any blow-ups. This will suffice for our applications.
Following this, in §4, we will turn to the extrinsic approach and study the relation of order domains with the toric (monomial) algebras that appear as coordinate rings of affine toric varieties. The connection is that the conditions in Geil and Pellikaan's theorem are equivalent to saying that the order domain R has a flat deformation to a toric algebra. See Theorem 4 below for a more precise statement. This point of view shows that there are intriguing connections between order domains and techniques of current interest in combinatorics, the theory of singularities, mirror symmetry, and other areas.
Next, in §5 and §6 we will present several new explicit examples of order domains obtained from varieties such as Hermitian hypersurfaces of arbitrary dimension, Grassmannians, and flag varieties. These varieties have been studied with other tools in this context by S. Hansen in [11], Rodier in [19], [20] (also see the references in those papers for earlier work). These particular varieties are interesting in this connection because they are examples of higher-dimensional varieties with large numbers of rational points over finite fields. By our results, they can be used to construct long codes for which the BMS algorithm, the Feng-Rao bound, and majority voting for unknown syndromes apply.
The treatment of Hermitian hypersurfaces in §5 will use the intrinsic approach to construct valuations of one of the types studied in §3. We will then produce presentations of the corresponding order domains as in Geil and Pellikaan's theorem (Theorem 1). A different construction based on the result of §4 will yield a second class of order domains whose properties even more closely parallel the order domains from Hermitian curves.
In §6, on the other hand, we will study order domains from Grassmannians and flag varieties via the extrinsic approach. Our results here depend on work of Sturmfels ( [22]) and Gonciulea and Lakshmibai ([9]) establishing the existence of toric deformations of these varieties. These examples can also be treated using the theory of Hodge algebras, or algebras with straightening laws (ASL); see [5]. We note that these algebras also give a sort of generalization of Gröbner basis theory. While there is a large overlap, the classes of Hodge algebras and order domains are distinct; neither class contains the other.
The author would like to thank Ed Mosteig and Mike O'Sullivan for enlightening conversations. Work reported in this article was begun while the author was visiting MSRI during the Commutative Algebra program in Spring 2003.

Preliminaries on Order Domains and Valuations
Essentially following [8], we will use the following formulation of the definition of order domains. Definition 1. Let R be a F q -algebra and let (Γ, +, ≻) be a well-ordered commutative semigroup. An order function on R is a surjective mapping ρ : R → {−∞} ∪ Γ satisfying: We will call Γ the value semigroup of ρ.
Axioms 1 and 5 in this definition imply that R is an integral domain. In many cases, we will see that a ring R with one order function has many others besides. For this reason an order domain is formally defined as a pair (R, ρ) where R is an F q -algebra and ρ is an order function on R. However, we will only use one particular order function on R at any one time. Hence we will often omit it in referring to the order domain, and we will refer to Γ as the value semigroup of R.
Let α ∈ Γ be arbitrary. The subsets R α = {f ∈ R : ρ(f ) ≤ α} or R <α = {f ∈ R : ρ(f ) < α} form filtrations of R by F q -vector subspaces. Axiom 4 implies that for each α, R α /R <α is a one-dimensional F q -vector space. The terminology "order function" is supposed to suggest the existence of F q -bases of R whose elements have distinct ρ-values, and are hence ordered by ρ. This is a consequence of the one-dimensional quotients axiom 4.
[8] and [18] contain a number of examples of order domains; we will provide additional examples in §5 and §6.
At this point a comment concerning the relation of this definition to the one used in [17] and [18] is probably in order. In those papers an order function is defined as a mapping o : R → N ∪ {−1} satisfying the properties that for all a, the set implies o(f z) < o(gz) for all f, g, z ∈ R. It can be seen that this formulation satisfies all the axioms in Definition 1, but it is less general than our definition. It excludes, for instance, R such as F q [X, Y ] with order function induced by a lexicographic monomial order (that is, the order function ρ(X n Y m ) = (m, n) ∈ Γ = Z 2 ≥0 , ordered lexicographically). Note for instance that the lexicographic order does not satisfy Proposition 1.2 of [17]. Nevertheless, lexicographic and similar orders on polynomial rings do furnish examples of order domains as in our definition. In particular the well-ordering property does hold, even though there is no power Y n satisfying ρ(Y n ) > ρ(X).
We will follow the notation and terminology of [25] for Krull valuations on function fields. Let K be a field. A valuation v of K is a mapping from K to Λ ∪ {+∞}, where Λ is a totally ordered abelian group satisfying Given any valuation on K, the corresponding valuation ring is We will always consider function fields K with a constant subfield k equal to a finite field F q . All valuations will be trivial on k (i.e. v(c) = 0, if c ∈ k). The dimension of v is the transcendence degree of k v over k. We will be concerned only with valuations of dimension 0, so the residue field will be at most an algebraic extension of the constant field.
Let Λ be the value group of a valuation. A subset Σ ⊆ Λ is said to be a segment if whenever β ∈ Λ is between −σ and σ (in the order) for some σ ∈ Σ, then β ∈ Σ. An isolated subgroup of Λ is a proper subgroup that is also a segment. The rank of a valuation v is the number of isolated subgroups of the value group (or ∞ if that number is not finite). The The valuation v is said to be discrete if its value group is a discrete group of finite rank, that is, isomorphic to a subgroup of Z n for some n, ordered by the lexicographic order.
Let K be the function field of a variety X . We say a valuation v is centered at a (closed) point Q ∈ X if we have the containment of local rings O X ,Q ⊆ S v , and the maximal ideals satisfy M v ∩ O X ,Q = M X ,Q .

Constructing Order Domains from Valuations
As shown in [17] and [8], every order function ρ on R determines a valuation v on K = QF (R), defined by: Note the signs; it follows that ρ = −v| R . The value group of this v is the group of differences Λ = Γ − Γ, and the ordering is induced by the ordering on Γ.
From (1), it can be seen that the order domain R and the valuation ring S v for the valuation corresponding to ρ are in a special relative position in K = QF (R) = QF (S v ). Namely, we have the following statement. Proposition 1. Let R be an order domain, and S v be the corresponding valuation ring of K = R as above.
Proof. Both claims follow from the definitions. We have . By axioms 2 and 5 in Definition 1, if ρ(h) = 0, then h must be constant (an element of F q ), and conversely. So In other words, the valuation v has dimension dim(v) = 0, according to the terminology from §2, since S v /M v = F q . Moreover, the valuation ring S v is an F q -complementary valuation ring to R in the terminology of [16]. (Note that the definition of a valuation considered in that article is essentially the extension of our order function ρ to K: v(f /g) = ρ(f ) − ρ(g), rather than the negative as in (1).) In [16], the connection between valuations and filtrations is considered in detail, and in Theorem 4.4, Lemmas 4.7 and 4.8, and Proposition 4.9 it is shown that there is a one-to-one correspondence between F q -complementary valuation rings to a subring R in K and regular, normalized filtrations on R. The properties of these regular, normalized filtrations, in particular the one-dimensionality over F q of the graded quotients, are equivalent to the axioms defining an order domain as in Definition 1.
We now want to turn the tables and show how to produce examples of order domains starting from valuations. The following theorem gives a general class of valuations on function fields K = K(X ) for which there are corresponding order domains R ⊂ K. We restrict to R of this special form because this seems to be the most important case for applications in coding theory.
where I is a prime ideal. Let X be the projective closure of V (I) in P s , and let H 0 (with reduced scheme structure) be the intersection of X with the hyperplane at infinity. Assume H 0 is an irreducible divisor on X . Let v be any valuation on the function field K(X ) such that (Note that we can view R as a subring of K consisting of functions with poles on H 0 .) Proof. Hypothesis 1 implies that the Abhyankar inequality for v: (see [25], Théorème 9.2) is an equality. Hence, by part b of that theorem, the valuation group of v is isomorphic (as a group) to Z d . The rank of v may be any integer r with 1 ≤ r ≤ d, though, so the ordering may be any one of a number of different possibilities. For example, we may have Λ discrete (the case r = d), Λ a subgroup of R generated by d Q-linearly independent real numbers (the case r = 1), or an intermediate case.
Axioms 1, 2, 3, and 5 in the definition of an order function follow immediately from the definition of a valuation, and show that Γ = ρ(R) is a semigroup contained in the value group Λ of v.
To show that the one-dimensional quotients axiom 4 holds, we will use Theorem 4.4, vii from [16]. We must show that S v ∩ R = F q (that is, that S v and R are in F q -complementary position in K). This follows from the irreducibility of H 0 and hypothesis 2. The nonconstant f ∈ R are not contained in S v by hypothesis 3.
What remains to be proved is that Γ = ρ(R) = −v(R) is well-ordered. We will use the following criterion. Lemma 1. Let (Γ, +) be any finitely generated inverse-free semigroup. If ≺ is any total order on Γ compatible with the addition operation (in the sense that α ≺ β implies α + γ ≺ β + γ for all α, β, γ ∈ Γ), then Γ is well-ordered under ≺.
A proof of the Lemma is sketched on page 371 of [8]. Our Γ is clearly inverse-free, since Γ is contained in the set of elements of the value group Λ that are ≥ 0. The order on Γ is induced from that on Λ, so is compatible with addition. So we are reduced to showing that Γ is finitely generated. This follows, for instance, from the Noether Normalization theorem (see [27], Chapter VII, §7, Theorem 35, or [10], Theorem 3.4.1, and Exercises 3.4.1 and 3.4.2). There exists a transcendence basis {z 1 , . . . , z d } in R such that R is a finite, integral extension of the polynomial ring F q [z 1 , . . . , z d ]. Γ is generated by the values ρ(z i ) and the ρ-values for the elements of a basis of R over F q [z 1 , . . . , z d ]. Indeed, we obtain from the Gröbner basis algorithm for Noether Normalization described in [10] a monomial F q -basis for R consisting of products of arbitrary monomials in the z 1 , . . . , z d with a finite list of monomials in the remaining variables. The values of ρ on these basis monomials are distinct. Otherwise, we would have an algebraic dependence because of the one-dimensional quotients property.
The ρ given by this theorem are all monomial order functions as defined in [17]. To construct one class of valuations as in Theorem 2 in a simple fashion, starting from the geometry of the variety X , we can use the well-known composite divisorial valuations described, for instance, in [25], Example 9 and the following remark (see also [2] for relations between these valuations and monomial orderings in the theory of Gröbner bases).
Let X be a projective variety of dimension d defined over a finite field F q , and let be a flag of subvarieties of X satisfying the following conditions: Since each V i+1 is an irreducible divisor in V i , each rational function g on V i+1 has a well-defined (vanishing or pole) order along V i+1 , denoted ord Vi+1 (g). By definition, ord Vi+1 (g) is positive if g vanishes along V i+1 , and negative if g has a pole along V i+1 . We note that it also follows from these hypotheses that V d is a smooth F q -rational point on the irreducible curve V d−1 .
Any such flag F defines a valuation v F on the function field K = K(X ) as follows. For each i, fix some function g i on the subvariety V i−1 with a zero of order 1 along V i . Given any f ∈ K, we define a sequence of integers (the notation F | Vi means the function F , restricted to the variety Then v F is a discrete valuation of K with rational rank d, rank d, and value group Z d , ordered lexicographically. The values v F (f ) depend on the choice of the auxiliary functions g i . However all choices of g i will lead to equivalent orderings. Indeed, note that the auxiliary functions are unnecessary for comparing valuations of two functions f and f ′ ; the comparison can be made using only the orders For example, it is easy to see that the lexicographic order on R = F q [X 1 , . . . , X s ] (the affine coordinate ring of a standard affine subset of The center is the origin in the affine plane, and this shows that lexicographic order functions on the polynomial ring R do not come from the construction of Theorem 2. Similarly, it is not difficult to see that graded reverse lexicographic monomial orders on this R come from composite divisorial valuations constructed from subvarieties on a blow-up of P s (see [2], §1, for example). In the following, if we wanted to consider order functions like the graded reverse lexicographic order, in effect, X would be the blow-up of P s . Theorem 3. Let X be any projective variety over F q which has a flag F of subvarieties defined over F q satisfying the hypotheses above, and such that V 1 is ample on X (that is, the complete linear system |ℓV 1 | defines a projective embedding of X for some ℓ ≥ 1). Let v F be the corresponding valuation of the function field K = K(X ) defined in (3). Let R be the subring R = ∪ ∞ m=0 L(mV 1 ) (the subring of K consisting of functions with poles only along the subvariety V 1 ). Let Then ρ is an order function on R.
Proof. This follows from Theorem 2 on reembedding X so that the divisor ℓV 1 becomes the hyperplane section H 0 . The center of the valuation is the point Q = V d .
The v F valuations have rational rank d = dim X by construction.
The well-ordering property of the image of ρ also follows by a direct argument in this case. Suppose we had an infinite strictly descending chain: where f i ∈ R for all i and > denotes the lexicographic order in Z r . The f i must be non-constant, so by the definition of R the first components of ρ(f i ) (that is, the integers −ord V1 (f i )) are strictly positive. This follows since there are no nonconstant functions in R with a pole of order ≤ 0 along V 1 (recall that functions in R can have poles only along V 1 ). Hence the first components stabilize after a finite number of steps in the chain (4): There exists i 0 ≥ 1 such that ord V1 (f j ) = ord V1 (f i0 ) = n for all j ≥ i 0 and some n ≥ 1. The set of rational functions on X with a pole of order at most n along V 1 and no other poles (together with the zero function) forms a finite-dimensional vector space over the field of constants (this follows, for example from [12], Chapter II, Theorem 5.19). Hence the orders of poles and zeroes of the As a result, the chain (4) must eventually stabilize. (It would also be possible to find a sub-semigroup of Z d ≥0 isomorphic to the image of ρ. An example of this is given in §4 below.) Note that when r ≥ 2, the choice of V 1 determines the ring R, but the choice of rest of the flag F still possibly yields many different order functions on R. Moreover, the rest of the flag is necessary because the pole order ord V1 (f ) alone gives a filtration of K too coarse to satisfy the one-dimensional quotients axiom 4 in the definition of an order function. As noted before, V d is a smooth point of the irreducible curve V d−1 . Hence ord V d is a discrete, rank 1 valuation on the function field of V d−1 and the one-dimensional quotients property in axiom 4 also follows directly for these valuations from this observation.
Even if a given variety X defined over F q does not have any suitable flags of subvarieties defined over the field F q , they always exist over the algebraic closure F q , hence over some finite extension of F q .
Another way to frame what Theorem 3 says is the following. If we think of the divisor V 1 in the flag used in the proof as the intersection of the image of X under this new embedding with the hyperplane at infinity, then the coordinate ring of the affine variety X \V 1 will have order functions.
For a very simple example, consider the ring R = F q [X, Y ]/ XY − 1 cited in [14] as a ring with no order functions as in Definition 1. In geometric terms, this is the coordinate ring of an affine subset of the projective conic V (XY − Z 2 ), which is birationally isomorphic to X = P 1 (the function field is isomorphic to the field of rational functions in one variable). There are many ways to embed P 1 to yield examples of order domains. In fact in this case, a simple linear change of coordinates to make the hyperplane at infinity tangent to the curve will produce a conic curve that does yield an order domain: Corollary 1. Any projective variety X which has a suitable flag of subvarieties defined over F q can be used to construct evaluation and dual evaluation codes for which the BMS algorithm and the Feng-Rao procedure are applicable.
Though we have considerable freedom in the choice of the flag F , the composite divisorial valuations v F in no way exhaust the valuations described in Theorem 2.

Order Domains from Toric Deformations
This section is devoted to the observation that the extrinsic characterization of order domains from Theorem 1 can be reinterpreted in another way giving a way to generate additional examples of order domains.
Given a semigroup Γ ⊆ Z r ≥0 , let R Γ be the subring of F q [T 1 , . . . , T r ] generated by the monomials T γ for γ ∈ Γ. By [8], Proposition 4.8, R Γ is an order domain with value semgroup Γ. Moreover, the graded algebra Gr(R) of any order domain R with value semigroup Γ is isomorphic to R Γ by [8], Proposition 6.5.
A first connection with the extrinsic characterization in Theorem 1 is given by [8], Proposition 10.6. Let M be the r × s matrix whose columns are γ 1 , . . . , γ s in some generating set for Γ. We define I Γ to be the binomial ideal generated by the X α − X β such that M α = M β. In the literature, I Γ is also known as the toric ideal corresponding to Γ. The variety V (I Γ ) is toric (but is not necessarily a normal variety, as is sometimes required in the study of toric varieties).
In this section we will prove the following complement of these results. where I has a Gröbner basis of the form described in part 1 of Theorem 1. The deformation can be seen explicitly as follows. Let ω be a general linear combination of the rows of the matrix M in Theorem 1. Then we get a one-parameter family of varieties over A 1 t by mapping X i → t −ωi X i in the Gröbner basis elements for I. Clearing denominators, the terms of non-maximal M -weight in the generators of I vanish on letting t → 0, and the limiting ideal is the binomial ideal I Γ . Flatness follows from the requirement in Theorem 1 that the specified generators of I form a Gröbner basis. (See, for instance, [10], section 7.5. In our case, the deformation is to the binomial ideal I Γ rather than a monomial ideal, but the idea is the same.) The converse is just a restatement of Geil and Pellikaan's theorem.

Theorem 4. Let R be an order domain with a given finitely-generated value semi-
The corresponding affine varieties V (I) defined by the ideals I in Theorem 1 are flat deformations of the toric variety V (I Γ ).
In the next sections, we will consider several examples of the way order domains can be identified from explicit varieties of interest in coding theory. We will show the existence of order functions both by using Theorem 3 and by using Theorem 4.

Order Domains and Codes from Hermitian Hypersurfaces
In this section, we will begin by considering order domains associated to Hermitian hypersurfaces in P r+1 over a field F q 2 , for any r ≥ 1. These varieties have a number of properties that make them interesting for the construction of codes, such as large numbers of F q 2 -rational points, large automorphism groups, and so forth. The case of Hermitian curves in the plane has, of course, been extensively studied by many coding theorists over the past 15 years. Hermitian hypersurfaces have been considered by S. Hansen ([11]) and Rodier ([19]).
We will take the following as the standard projective embedding of the Hermitian hypersurface: Example 1. We will begin by constructing an explicit order domain from the Hermitian surface H 2 in P 3 . If we use the standard form (5) for the defining equation, then the hyperplane section V 1 = V (X 0 ) ∩ H 2 is a smooth Hermitian curve in the plane V (X 0 ). We can then select any F q 2 -rational point on V 1 to be the point V 2 in a flag F : The corresponding ring R = ∪ ∞ m=0 L(mV 1 ) thus has the structure of an order domain, where ρ is constructed from a composite divisorial valuation as in Theorem 3. To work explicitly with R, note that the rational functions that are contained in R (in which the denominators can only contain powers of X 0 ) can be identified with polynomials in X 1 , X 2 , X 3 , after dehomogenizing with respect to X 0 . We have the following results by easy computations: Moreover, by axiom 4 in Definition 1, we expect some linear combination of X 1 and X 2 to have smaller ρ-value than ρ(X 1 ) = ρ(X 2 ). This linear combination comes from the equation of the tangent line to the curve V 1 at the point V 2 : We will write U = δX 1 − X 2 in the following.
Since there are no linear polynomials in X 1 , X 2 , X 3 on V 1 vanishing to order higher than q + 1 at V 2 , we can also obtain an order-preserving linear mapping from the value group of ρ to a sub-semigroup of Z 2 ≥0 (with the lexicographic order) by mapping (a, b) → (a, (q + 1)a + b). Composing with ρ gives a new order functioñ ρ : R → Γ ⊂ Z 2 ≥0 as in Geil and Pellikaan's extrinsic characterization of order domains. We haveρ To put R into Geil and Pellikaan's form, we will make a linear change of coordinates, substituting X 2 = δX 1 − U and writing the equation in terms of X 1 , U, X 3 . (From Theorem 1, recall that the columns of the weight matrix M should generate the value semigroup of R, so from (6) we see that U should be used to replace X 2 .) The result is the equation: We use the monomial order > M,lex , where M = 1 1 1 q + 1 0 q comes from theρ-values above. Note that the columns of M correspond to X 1 , U, X 3 in that order, but the variables are ordered X 1 > X 3 > U according to > M,lex . We see that F has exactly two terms of highest M -weight (with the monomials X q+1 3 and X q 1 U ). Moreover, the leading term is X q+1

3
, and the monomials in the complement of the initial ideal are The Hermitian surface H 2 has (q 2 +1)(q 3 +1) F q 2 -rational points, of which q 3 +1 lie on V (X 0 ). Hence evaluation and dual evaluation codes of length n = q 2 (q 3 + 1) can be constructed by this method from R, using the ordering induced byρ on the monomials in ∆ from (8). We will discuss the analogous codes constructed from all H r in more detail below. The BMS algorithm applies for decoding the dual of the evaluation code with basis formed by evaluation of the first ℓ monomials in ∆ (in the > M,lex order), for any ℓ ≥ 1. ♦ The construction in this example can be extended by a natural inductive procedure to define order domains from all the Hermitian hypersurfaces.
We now present some more detailed information concerning some codes constructed from these Hermitian hypersurfaces. So that we will be in the setup for O'Sullivan's generalized BMS algorithm, we will consider codes obtained by evaluation of polynomials in X 1 , . . . , X r−1 , U, X r+1 at the affine F q 2 -rational points on H r . Let C a , a ≥ 1, denote the code defined by the monomials of total degree ≤ a. (Note that since the first component of ρ(X j ) is 1 for all j, the orders > M,τ are all graded orders, so if a ≤ q, the C a code is spanned by the evaluations of the first a+r+1 a monomials in this order and has the form needed for BMS.) Theorem 5. The C 1 code over F q 2 defined in this way from H r ⊂ P r+1 has the following parameters: Proof. We use the results from [1]. The number of F q 2 -rational points of the Hermitian hypersurface H r is The intersection of H r with the hyperplane X 0 = 0 at infinity is isomorphic to the Hermitian variety H r−1 . Hence by (9), the number of affine F q 2 -rational points is This yields the blocklength n of the C a codes for all a ≥ 1. The dimension of C 1 is k = r + 2 since the codewords obtained by evaluation of 1, X 1 , . . . , X r−1 , X r+1 , U are linearly independent.
To determine the minimum distance d, we must determine the largest possible number of affine F q 2 -rational points in an intersection H r ∩ L where L is the hyperplane in P r+1 defined by a linear form. By [1] again, there are exactly two cases for L defined over F q 2 . Either L intersects H r transversely and H r ∩ L is isomorphic to H r−1 as in the case of the hyperplane at infinity above, or else L is the tangent hyperplane to H r at an F q 2 -rational point p and in that case H r ∩ L is isomorphic to the cone over H r−2 with vertex at p.
If r is even, using (9) above, it is easily checked that the largest number of affine F q 2 -rational points on L is attained when L is tangent to H r at a point p in X 0 = 0. This number is z = q 2r−1 + q r and d = n − z gives the desired result. On the other hand, if r is odd, then the maximum is attained when L, H r , and the hyperplane X 0 intersect transversely. We have z = q 2r−1 + q r−1 in this case.
For example, with q = 2, the Hermitian hypersurfaces yield C 1 codes as follows over F 4 : For large q, in an asymptotic sense the C 1 codes come close to achieving the Griesmer bound on n for the given k and d. For instance, with r = 5, the Griesmer bound gives for a code with k = r + 2 = 7 and d = q 11 − q 9 − q 5 − q 4 over F q 2 . The actual n for our C 1 code is q 11 − q 5 . The ratio of the bound and the actual n tends to 1 as q → ∞. The minimum distances of the C a codes for a ≥ 2 can be estimated by the tools in [11] and [19], but determining the exact d is somewhat subtle in these cases because of the many cases that must be considered.
As noted in [20] and [11], there is also a close connection between Hermitian hypersurface codes and codes from the Deligne-Lusztig varieties from one class of algebraic groups over finite fields. Deligne-Lusztig varieties are a class of varieties with many rational points over finite fields. Indeed they often attain the maximum number for varieties with their invariants. For instance, the Deligne-Lusztig variety of type 2 A 2 is just the Hermitian curve H 1 in P 2 , which has the maximum possible number of points for a curve of its genus allowed by the Hasse-Weil bound. The variety of type 2 A 3 is the blow-up of the Hermitian surface H 2 at its F q 2 -rational points and is again maximal. The variety of type 2 A 4 is obtained from the complete intersection of the Hermitian 3-fold H 3 in P 4 and the hypersurface a surface with singularities precisely at the (q 5 + 1)(q 2 + 1) F q 2 -rational points of H 3 . Each of those singular points blows up to a Hermitian curve on the Deligne-Lusztig variety. In each case, some of the more accessible Deligne-Lusztig codes "come from" C a evaluation codes on the Hermitian hypersuface (see Proposition 4.1 and Remark 4.1 of [11]).
To conclude this section, we note that there is a different way to construct order domains from the Hermitian hypersurfaces which gives a direct parallel to another form of the equation of the Hermitian curve. In the case r = 1, it is also common to consider a linear change of coordinates (see [21], Example VI.4.3): (X, Y, Z) = (δX 2 , δ(γ + 1)X 0 + γX 1 , δX 0 + X 1 ), where δ, γ ∈ F q 2 satisfy δ q+1 = γ q + γ = −1. In geometric terms, this has the effect of making the line at infinity tangent to the curve H 1 at an F q 2 -rational point. The intersection multiplicity of the tangent line with the curve at the point of tangency is q + 1. The corresponding equation has the familiar form From this, we can see easily that the hypotheses of Theorem 1 are satisfied if we define an order function on the affine coordinate ring The value semigroup is Γ = q, q + 1 ⊂ Z ≥0 , and as in §4, we can view the usual order domain associated to the Hermitian curve as a deformation of the monomial algebra F q 2 [t q , t q+1 ] (the coordinate ring of a singular monomial curve).
As compared with the first construction above, this form puts a tangent plane to the surface rather than a plane meeting the surface transversely as the plane at infinity. If we dehomogenize by setting Z = 1, then we claim that the corresponding affine algebra has an order function ρ defined by the matrix M ′ = q 0 q + 1 0 1 0 (for example). The > M ′ ,lex order makes the leading term X q+1 and there are exactly two terms of maximal M ′ -weight. The monomials in the complement of the initial ideal are . An easy argument parallel to the one above shows that the monomials ∆ ′ have distinct M -weights. Hence the hypotheses of Geil and Pellikaan's theorem are satisfied here too, and we get an order function on R ′ . The corresponding valuation on the function field of the Hermitian surface is not of the form used in Theorem 3, however. Indeed, the easiest way to describe this order domain seems to be as a deformation of the product of order domains of the curve (10) and a line (see [8], Proposition 7.5).
By the facts used in the proof of Theorem 5, the tangent planes to the Hermitian surface at all F q 2 -rational points intersect the surface H 2 in reducible curves, each consisting of q + 1 distinct lines passing through the point of tangency. This reduces the number of affine F q 2 -rational points on the variety defined by (11) to q 5 (from q 5 + q 2 as in Theorem 5). But this loss may be compensated to an extent by some of the other properties of the resulting codes.
For example, we observe that all the evaluation and dual evaluation codes constructed from R ′ in (11) have the same sort of quasicyclic structure studied in [13].
Namely, this affine piece of the Hermitian surface has a large automorphism group containing a cyclic subgroup H of order q 2 − 1 generated by the automorphism where α is any primitive element of F q 2 . ♦ Proposition 3. The q 5 affine F q 2 -rational points decompose into q 3 + q orbits of size q 2 − 1, one orbit of size q − 1 and one orbit of size 1 under the action of H.
Proof. The point (0, 0, 0) is clearly the only fixed point of H. The other q − 1 points on the line X = X 1 = 0 form the orbit of size q − 1. The orbit of each other F q 2 -rational point has size q 2 − 1.
As in [13], this gives all of the evaluation and dual evaluation codes constructed from R ′ the structure of modules over F q 2 [t], and compact representations for encoding.

Order Domains from Grassmannians and Flag Varieties
The codes from Grassmannians and flag varieties that come from the construction we will describe have been studied by Rodier in [19], but the connection with order domains was not studied in that work. Geil has constructed order domains from the Grassmannians G(2, n) (see below for the notation) in [7] (see Example 9.4 of [8]). The new observation here is that all of these Grassmannians and flag varieties, and the codes constructed from them, can be studied within the context of order domains.
Theorem 4 shows that any known explicit flat deformation of a variety to a toric variety (toric deformations for short) can be used to produce examples of order domains, using the extrinsic characterization in Theorem 1. In this section, we will see that this is true in particular for Grassmannians, and for flag varieties. The fact that toric deformations exist in these cases has been established in algebraic geometry (because of connections with combinatorics, mirror symmetry, and the theory of singularities).
The book [22] is an excellent general reference for the aspects of the theory of toric varieties of greatest relevance here. We will use several results presented in Chapter 11 of [22] to construct our examples. We will begin with the case of Grassmannians and furnish an answer to a question posed in [8], Example 9.4, concerning the varieties defined by minors of arbitrary size of generic matrices. The Grassmannians correspond to the case of the maximal minors of a rectangular matrix.
Recall that the Grassmannian G(k, n) is a projective variety whose points are in one-to-one correspondence with the k-dimensional vector subspaces of an ndimensional vector space (or the (k − 1)-dimensional linear subvarieties in P n−1 ). We will not use the projective case here. We very briefly recall the construction, since it shows that the F q -rational points of G(k, n) correspond to linear subspaces defined over F q , it explains the connection with minors of matrices, and it also shows how to find toric deformations of Grassmannians.
We write F for an algebraic closure of our field. Given any basis {v 1 , . . . , v k } for a k-dimensional vector subspace W of F n , we form the k ×n matrix with rows v i . The k × k (maximal) minors of this matrix are components of the Plücker coordinate vector of W in P ( n k )−1 . This is a well-defined invariant of W because a change of basis multiplies all components of the Plücker coordinate vector by a nonzero constant (the determinant of the change of basis matrix). Hence any choice of basis in W yields the same point in P ( n k )−1 . The locus of all such points (for all W ) forms the Grassmannian G(k, n).
Our extrinsic construction of order domains from Grassmannians relies on the following fact from [22]. Proposition 4 ( [22], Proposition 11.10). There exists a toric deformation taking G(k, n) to the projective toric variety defined by the semigroup Γ k,n defined as follows: Let N = (t ij ) be a generic k × n matrix (the t ij are independent indeterminates). Then Γ k,n is the semigroup in Z ( n k ) ≥0 generated by the columns of the n k × kn matrix B k,n , whose ℓth row has 1's in the positions corresponding to the t ij in the diagonal of the ℓth minor of N , and zeroes in all other positions. This is deduced from properties of canonical ("SAGBI") bases for subalgebras of polynomial rings (like the monomial algebra F q [Γ] above) in [22].
Corollary 2. For all k, n, the Grassmannians G(k, n) yield order domains with value semigroup Γ k,n .
Proof. This follows immediately from Theorem 4 and Proposition 4.
We will illustrate the conclusion by considering the case of G (3,5) here. This is one of the simplest cases not covered by results in [7] quoted in Example 9.4 of [8], and shows how the general proof of Theorem 4 works. Example 3. Let N =   t 11 t 12 · · · t 15 t 21 t 22 · · · t 25 t 31 t 32 · · · t 35   be the generic 3×5 matrix. There are 5 3 = 10 maximal minors of N . The diagonal terms are (12) t 11 t 22 t 33 , t 11 t 22 t 34 , . . . , t 13 t 24 t 35 .
The corresponding matrix B 3,5 as in the statement of Proposition 4 is the following (columns are indexed by the entries of N , listed row-wise): The columns of B 3,5 generate the semigroup Γ 3,5 . Write X 1 , . . . , X 10 for the coordinates in P 10 . The toric variety corresponding to F q [Γ 3,5 ] is given by the parametrization X 1 = t 11 t 22 t 33 , X 2 = t 11 t 22 t 34 , . . . , X 10 = t 13 t 24 t 35 (using (12)). Eliminating the t ij , we find the graded reverse lex Gröbner basis of I Γ3,5 equals (the positive term is the leading term in each case). The corresponding projective toric variety has dimension 6 and degree 5 in P 9 ; the equations above can also be viewed as defining the affine cone over that projective variety, which has dimension 7 in A 10 . The ideal of the Grassmannian G(3, 5) is generated by quadratic polynomials called the Plücker relations between the Plücker coordinate vectors of 3-planes W . We have the following Gröbner basis for this ideal with respect to the same graded reverse lex order as in (13): X 7 X 3 − X 8 X 2 + X 1 X 9 , To understand the order domain structure here, we need to introduce the weight matrix M = B t 3,5 , a 15 × 10 matrix of rank 7. In our discussion of the weight orders in Geil and Pellikaan's theorem (Theorem 1), note that we used only matrices where the number of rows equals the rank of the corresponding valuation of the function field. That is not necessary, though. It would be perfectly legal to define a matrix weight order using the full matrix M ; the value semigroup is then a sub-semigroup in Z 15 ≥0 whose rank is 7. Note that in each polynomial in (14), the same two terms as in the corresponding polynomial in (13) appear. These are the terms of maximum M -weight in each case. The remaining terms in (14) have smaller M -weight. So the ideal in (13) is indeed a toric deformation of the ideal in (14).
Moreover by the construction here, two monomials in the X i , say X α and X β , have the same weight if and only if M α = M β. But that implies X α − X β is in the toric ideal I Γ3,5 , so one of the monomials is divisible by one of the leading terms of G G or G T . This shows that (14) satisfies all the hypotheses of Theorem 1. Hence we have constructed an order domain from the Grassmannian G(3, 5) (or more properly, the affine cone over the Grassmannian) with the homogeneous ideal given by (14). We could also set X 1 = 1 to obtain an affine algebra corresponding to an affine subset of the Grassmannian itself if we wish, and the corresponding weight matrix M ′ would be the rank 6 matrix obtained by transposing the submatrix of B 3,5 formed by omitting the first row. ♦ Just as the Grassmannian G(k, n) is a projective variety whose points correspond to the k-dimensional vector subspaces of n-space, the partial flag variety F (n 1 , . . . , n ℓ ; n) is a variety whose points correspond to partial flags of vector subspaces: V 1 ⊂ V 2 ⊂ · · · ⊂ V ℓ in n-space, where dim(V i ) = n i for all i = 1, . . . , ℓ. By considering the Plücker embeddings, we have a natural inclusion F (n 1 , . . . , n ℓ ; n) ⊂ P N1−1 × · · · × P N ℓ −1 , where N i = n ni . The flag variety is then defined in this product of projective spaces by the conditions that V 1 ⊂ V 2 ⊂ · · · V ℓ . If desired, the product of projective spaces can also be embedded in a single projective space by the usual Segre mapping.
The existence of toric deformations of all F (n 1 , . . . , n ℓ ; n) is known from work of Gonciulea and Lakshmibai ([9], Theorem 10.6). A more combinatorial description similar to that provided by Sturmfels for the Grassmannians has appeared in [15]. We review this and indicate how to derive explicit order domains from F (n 1 , . . . , n ℓ ; n).
Note that the elements of H are in one-to-one correspondence with the Plücker coordinates on G(n 1 , n) × G(n 2 , n) × · · · × G(n ℓ , n).
Given π ∈ H, we will write p π for the corresponding Plücker coordinate.
The set H is a distributive lattice under the partial order relation .
For each pair of elements π, π ′ that are incomparable in the ordering on H, there is a quadratic (Grassmann-Plücker) relation (15) p π p π ′ = c λµ p λ p µ .
Example 4. We consider the flag varieties F (1, n − 1; n) studied in [19]. In particular, that article shows the corresponding codes compare very favorably with projective Reed-Muller codes. The same techniques would be applicable to all these flag varieties. In this case the set H defined above reduces to whereĵ = (1, . . . , j − 1, j + 1, . . . , n). Using the definition of the partial order , we have (n) (n − 1) · · · (1),