Manuscript Offprint
arXiv:2609.06441Random Algebraic Geometry Codes Approach the Half-Singleton Bound for Insertions and Deletions
Abstract
In this paper, we study the performance of algebraic geometry (AG) codes against adversarial insertion-deletion (insdel) errors. The half-Singleton bound states that an linear code can correct at most insdel errors. It was recently proven that random Reed-Solomon codes approach this bound. However, these constructions require the field size to grow linearly with the code length . We overcome this barrier by extending the probabilistic analysis of general linear insdel codes to AG codes. We demonstrate that curves with many rational points allow for nearly optimal codes over significantly smaller alphabets.
We prove the following main asymptotic results: (1) For general smooth complete curves of fixed genus, random AG codes are nearly optimal, that is, they can correct insdel errors with high probability over linear-sized fields . (2) By utilizing Hermitian curves, we achieve this optimality over sublinear fields of size , breaking the linear field size barrier. (3) Using asymptotically optimal García-Stichtenoth towers, we prove the existence of random AG codes that approach the half-Singleton bound with high probability over fields of size , independent of .
I. INTRODUCTION
Error-correcting codes are widely used in digital communication and storage systems to ensure data reliability. In classical coding theory, the dominant model is the Hamming metric, where errors alter symbol values but preserve their positions. However, modern applications increasingly face synchronization errors, primarily insertions and deletions (insdel errors). Unlike Hamming errors, insertions and deletions alter the sequence length, causing a loss of positional information. This “desynchronization” means the decoder cannot easily determine which received symbol corresponds to which original index, rendering standard algebraic decoding methods ineffective and making the design of optimal insdel codes significantly more challenging.
The study of codes for these errors began in the 1960s with the foundational work of Levenshtein, Varshamov [1] and Tenengolts [2]. For decades, constructing efficient codes remained a difficult open problem. Recently, however, there has been renewed interest in this field, with numerous studies focusing on designing codes capable of correcting insdel errors [3]–[15]. This resurgence is driven by critical real-world applications. For instance, in DNA-based data storage systems [16]–[19], insertion and deletion errors occur naturally during the synthesis and sequencing processes. Similarly, in racetrack memory [20], data is stored in magnetic domains that move along a wire, where imprecise shifts can cause synchronization errors. These technologies necessitate efficient codes capable of handling such disturbances.
Linear codes are particularly desirable for these applications due to their compact representation and support for efficient encoding and decoding algorithms. The study of linear codes for insertion and deletion errors has advanced significantly in recent years. It was first established by Abdel-Ghaffar et al. [21] that any linear code capable of correcting a single deletion must have a rate of at most . Later, Cheng, Guruswami, Haeupler, and Li [22] established the half-Singleton bound, which implies that any linear code can correct at most insdel errors. Ji et al. [23] tightened this limit to the strict half-Singleton bound, showing that codes lacking the all-one vector can correct at most errors. These bounds serve as the fundamental limits for linear insdel codes, analogous to the Singleton bound for Hamming errors.
Approaching this bound with efficient linear codes has been a major challenge. Cheng, Guruswami, Haeupler, and Li [22] constructed linear codes that correct a fraction of insdel errors with rate approaching as the alphabet size increases. Later, Cheng et al. [24] provided constructions for high-rate and high-noise regimes. A natural candidate for optimal linear codes is the family of Reed-Solomon (RS) codes, which are MDS codes widely used for Hamming errors. However, their performance against insdel errors remained an open problem for decades. Recently, Con, Shpilka, and Tamo [25] proved that RS codes can exactly achieve the half-Singleton bound, but their existential argument required a field size exponential in the dimension . Con, Guo, Li, and Zhang [26] significantly improved this result: they analyzed random RS codes and proved that they approach the half-Singleton bound, that is, correct errors with high probability over linear field sizes . In a different direction, Gross, Con, and Yaakobi [27] constructed explicit codes over , linear over , with rate that efficiently correct a fraction of insdel errors for ; they also gave fully linear codes over with rate .
While RS codes are arguably the most prominent linear codes, they have a significant limitation: the field size must exceed the code length . This restricts their use over small or fixed alphabets. To overcome this limitation, we turn to
This work was supported in part by the National Natural Science Foundation of China under Grant 12371523.
Z. Guan and H. Wei are with the School of Mathematics and Statistics, Xi'an Jiaotong University, Xi'an 710049, China (e-mail: guanzh@stu.xjtu.edu.cn; hjwei05@gmail.com).
algebraic geometry (AG) codes, which generalize Reed-Solomon codes by evaluating functions on algebraic curves at rational points. Curves with many -rational points can support code lengths larger than , making AG codes natural candidates for approaching the half-Singleton bound over smaller, and potentially constant-sized, fields.
In this paper, we investigate the asymptotic performance of AG codes against adversarial insertion and deletion errors. We examine whether the algebraic structure of curves can reduce the required field size while maintaining optimal error correction capability. Specifically, we analyze random codes generated by rational points on irreducible MDS varieties, that is, varieties not contained in any hyperplane passing through the origin, and then apply this framework to AG codes approaching the half-Singleton bound.
Throughout these informal statements, the underlying curve and one-point divisor are fixed. A random AG code is obtained by sampling and ordering distinct -rational points outside the support of the divisor and using them as evaluation points. Thus, only the evaluation points and their ordering are random.
Theorem I.1 (Informal, see Theorem V.7). For sufficiently large , let be a smooth complete curve of genus independent of , where . Then a random AG code constructed from , with rate , corrects insdel errors with probability tending to as .
This demonstrates that achieving the half-Singleton bound is not unique to Reed-Solomon codes arising from the projective line, but is a general feature of codes generated from MDS varieties.
Theorem I.2 (Informal, see Theorem V.8). For sufficiently large , let be a Hermitian curve over , where . Then a random AG code constructed from , with rate , can correct insdel errors with probability tending to as .
We focus on Hermitian curves for two reasons. First, Hermitian codes form a well-studied family of AG codes. Second, Hermitian curves attain the Hasse-Weil upper bound and therefore have an abundance of rational points. This allows us to construct codes over the sublinear-sized fields in the theorem above.
Theorem I.3 (Informal, see Theorem V.10). For any fixed rational rate and any fixed , there exists a prime power and an infinite family of random AG codes over with rate , such that the codes correct insdel errors with probability tending to 1 as the block length tends to infinity along the family.
This result overcomes the fundamental limitation of Reed-Solomon codes, proving that structured linear codes can approach the half-Singleton bound even when the alphabet size does not grow with the block length.
B. Our Approach and Related Work
Our goal is to provide codes that approach the half-Singleton bound over fields smaller than those required by Reed-Solomon codes. Our approach consists of three main steps. First, we introduce the notion of HS-optimal varieties and establish a geometric characterization of half-Singleton optimality. Specifically, we prove that an irreducible variety is HS-optimal if and only if it is an MDS variety. This result reduces the study of optimal linear codes for insertion-deletion errors to the verification of certain determinant conditions on algebraic varieties.
Second, we develop a probabilistic framework for random linear codes whose generator-matrix columns are sampled from rational points of an MDS variety over a finite field. The main challenge is to estimate the probability that the verification matrices associated with the half-Singleton bound fail to have full rank. We overcome this difficulty by combining a rank-certification procedure with geometric estimates on the number of rational points where a generic determinant vanishes.
Finally, we apply this framework to algebraic geometry codes. We show that generator matrices of suitable AG codes can be represented by sampling points from affine MDS curves. Therefore, by selecting curves with sufficiently many rational points, our probabilistic framework yields AG codes approaching the half-Singleton bound over fields of linear, sublinear, and constant size.
Our geometric approach is inspired by the generic non-vanishing framework developed by Brakensiek, Dhar, and Gopi [28]. They study polynomial codes generated by points on irreducible varieties and reduce generic determinant conditions on varieties to conditions on formal power series and subsequently to univariate monomials. We adapt this sequence of reductions to the verification matrices arising from insertion-deletion errors. In particular, the determinant conditions and the corresponding monomial base cases in our setting are different from those in polynomial-code constructions, as they are dictated by the half-Singleton bound rather than by the MDS or higher-order MDS conditions.
Our probabilistic analysis builds on the rank-certification framework developed by Con, Guo, Li, and Zhang [26] for random Reed-Solomon codes. Their method decomposes pairs of subsequences into chains and certifies the resulting blocks sequentially, using a reserve of additional chains to handle failed determinant checks. We adapt this strategy to codes whose generator-matrix columns are sampled from general MDS varieties. The extension is nontrivial: unlike the Reed-Solomon setting, where evaluation points lie on the projective line and failure probabilities can be bounded by counting bad field elements, our setting requires controlling specialization failures on arbitrary algebraic varieties through geometric estimates of rational points.
Our application to algebraic geometry codes is also related to the recent work of Brakensiek, Dhar, Gopi, and Zhang [29], where AG codes are analyzed through the viewpoint of generator-matrix columns sampled from algebraic varieties. Their work focuses on list-decoding properties and higher-order MDS codes, whereas we study insertion-deletion errors and the verification matrices governing HS-optimality. By combining the geometric characterization, the probabilistic framework, and the abundance of rational points on suitable algebraic curves, we obtain AG codes approaching the half-Singleton bound over substantially smaller alphabets than Reed-Solomon codes.
C. Organization
The paper is organized as follows. In Section II we establish necessary conditions for a linear code to correct a prescribed number of insdel errors and recall the algebraic foundations concerning varieties. Section III provides the theoretical foundation for our work, where we prove that an irreducible variety is HS-optimal if and only if it is MDS. In other words, generic vectors from a variety generate an MDS code if and only if they generate a code attaining the half-Singleton bound. In Section IV we develop our core probabilistic framework. Specifically, we use a chain decomposition technique to derive explicit upper bounds on the failure probability of random codes constructed from these varieties. Finally, in Section V, we apply this general framework to AG codes. We recall the necessary background on algebraic curves and derive our main asymptotic results for smooth complete curves of fixed genus, Hermitian curves, and the García-Stichtenoth tower, giving fields of linear, sublinear, and constant size, respectively.
II. PRELIMINARIES
In this section, we establish the foundational notation, define the insertion-deletion metric for linear codes, and review the necessary concepts from algebraic geometry used throughout this paper.
Let and . For a positive integer , let . For a prime power , let denote the finite field with elements. Let be a non-specific field, which can be either finite or infinite. Let be a vector space over with dimension .
For a vector and a subset of indices , we denote by the restriction of to the coordinates in . Similarly, for a matrix and , let denote the submatrix of consisting of the columns with indices in .
Given a matrix , we say that has full row rank if and that has full column rank if .
A. Codes and the Half-Singleton Bound
In this paper, a vector could also be viewed as a string or a sequence over the alphabet . A subsequence of a string is a string obtained by removing some (possibly none) of the symbols in . Let , be strings over an alphabet . A longest common subsequence between and is a subsequence of both and of maximal length. We denote by the length of a longest common subsequence.
For two vectors , the insertion-deletion (insdel) distance between and is the minimal number of insertions and deletions required to transform into . It can be verified that is indeed a metric on .
It has been proved that the insdel distance between any two vectors can be characterized by their longest common subsequences.
Lemma II.1 ( [30], Lemma 1). Let . Then we have
An linear code is a linear subspace of of dimension . The code rate is defined as the ratio . The insdel distance of the code , denoted by , is the minimum insdel distance between any pair of distinct codewords. A code of distance can correct up to insdel errors.
The fundamental limit for insdel codes is the half-Singleton Bound.
Lemma II.2 (Half-Singleton Bound, cf. Corollary 5.2 in [22]). Let , and let be an linear code over . Then can correct at most insertion-deletion errors; equivalently,
If the code C does not contain the all-one vector 1, this bound can be tightened to the strict half-Singleton bound:
Lemma II.3 (Strict Half-Singleton Bound, [23]). Let . Let be an linear code over . If , then it is capable of correcting at most insdel errors, that is,
Definition II.4 (Half-Singleton Optimal Codes). Let . We say a linear code is half-Singleton optimal (HS-optimal for abbreviation) if it achieves the half-Singleton bound, i.e., can correct insdel errors. A linear code is strict half-Singleton optimal (strict HS-optimal for abbreviation) if and can correct insdel errors.
These two notions are directly related: shortening an HS-optimal code C yields a strictly HS-optimal code.
Lemma II.5. Let . Let be an code over with . By row transformations we can always suppose that is generated by a matrix of the form
Then the code generated by the matrix satisfies . In particular, if is HS-optimal, is strict HS-optimal. (See Appendix A for proof).
In this paper, we show that there exist AG codes over constant-sized fields that approach this bound. To capture this asymptotic behavior, we introduce the following relaxed notion of optimality.
Definition II.6 (Relaxation). Let . A linear code is -relaxed HS-optimal if it can correct at least
insdel errors when , and at least
insdel errors when .
To analyze the insdel capability of linear codes, we utilize the increasing subsequence framework.
Definition II.7 (Increasing Subsequence). An increasing subsequence is a tuple such that , where is called the length of .
Note that can be regarded as a subsequence of the sequence . For , we define the set of its indices .
For , let be an increasing subsequence made up of the corresponding equal components of and , i.e., , where and for all . In this case, we say and agree on coordinates. We now define the specific matrices that certify optimality.
Definition II.8. Let be an code generated by matrix , where is its -th column. For an integer and increasing subsequences of length , we define the verification matrix as follows:
• If 1 is not a codeword, we define as the matrix
• If 1 is a codeword, without loss of generality, assume the first row of is the all-one vector. Let denote the column obtained from by removing the first entry. We define as the matrix
The following lemma generalizes results from [23], providing a sufficient condition for optimality based on the rank of these matrices.
Lemma II.9. Let be an linear code, and let be an integer such that when and when . Assume that for every pair of increasing subsequences satisfying , the corresponding verification matrix has full row rank. Then
In particular, we have the following conditions for optimality:
• If , , and has full row rank for all relevant pairs, then is strict HS-optimal.
• If , , and has full row rank for all relevant pairs, then is HS-optimal.
• Let , and set if , and if . If and has full row rank for all relevant pairs, then is -relaxed HS-optimal.
Proof. Suppose, toward a contradiction, that two distinct codewords and have a common subsequence of length at least . Then there exist increasing subsequences such that . For every index , we have . Since , it follows that .
First suppose that . The nonzero row vector lies in the left kernel of because
Thus does not have full row rank, contradicting the hypothesis.
Now suppose that , and write and relative to a generator matrix whose first row is 1. Then the nonzero row vector lies in the left kernel of the corresponding verification matrix, since
This again contradicts the full-row-rank hypothesis. Therefore every pair of distinct codewords has longest common subsequence of length at most , and hence .
The first two particular cases follow by setting and , respectively. For the final case, the distance bound shows that the code can correct at least insdel errors. Substituting the stated value of in each case gives the two bounds in Definition II.6.
Sometimes we do not consider as a fixed matrix, but rather as a matrix of variables, or more specifically, a collection of column vectors treated as indeterminants. In such cases, we use the notation to explicitly indicate the dependency of the verification matrix on . Furthermore, for a matrix dependent on , we denote by for the specialization of where the -th column is set to the value for all indices , while all other columns remain as variables.
B. Algebraic Preliminaries
Let be an algebraically closed field, and let denote the -dimensional affine space over . For an ideal , let be its common zero set in . An affine variety is a subset of the form for some ideal . Conversely, the polynomials that vanish on form its vanishing ideal
An ideal is said to be radical if for some integer implies . By Hilbert's Nullstellensatz, there is a one-to-one correspondence between algebraic varieties and radical ideals; specifically, for any variety , is a radical ideal and .
The Zariski topology on a variety is the topology whose closed sets are the subsets , where is an ideal. A nonempty variety is called irreducible if it cannot be written as the union of two proper Zariski-closed subsets. Equivalently, is irreducible if and only if is a prime ideal.
The coordinate ring of is , whose elements can be viewed as polynomial functions on . If is irreducible, then is an integral domain; its field of fractions, denoted by , is the function field of . For , the set
is a basic Zariski open set, called a principal open set, whose complement is
We say that is generically non-vanishing on if is Zariski dense in , that is, if the closure of is . Thus, may vanish on a proper closed subset of , but not on a generic point of .
If is irreducible, then every nonempty Zariski open subset of is dense. Consequently, for , the following statements are equivalent:
-
f is generically non-vanishing on X.
-
There exists a point such that .
-
f is not the zero element in .
When working over a finite field , we view varieties as being defined over the algebraic closure . An -rational point of is a point on whose coordinates belong to . The set of all such points is denoted by .
We conclude with some lemmas summarizing the geometric properties required for our probabilistic analysis.
Lemma II.10 ([31]). If and are two varieties, then is also a variety. Furthermore, if and are irreducible, then so is .
To locally parameterize these varieties, we utilize formal power series. A formal power series ring over a field in variables , denoted by , is a generalization of a polynomial ring that allows for infinite sums of monomials.
Lemma II.11 (Lemma 6 in [28]). Let be an algebraically closed field and be an irreducible variety of dimension . There exist functions (depending on ) in the formal power series ring such that for any polynomial over it is generically non-vanishing over if and only if is non-zero.
Consequently, for the product variety , a multivariate polynomial over is generically non-vanishing over if and only if the substituted series is non-zero, where are distinct -tuples of formal variables for each .
Lemma II.12 (Adapted from Lemma 7 in [29]). Let and be irreducible varieties. Let be a polynomial in variables and that is generically non-vanishing over the product variety . Then, there exists a polynomial in the variables such that:
-
g is generically non-vanishing over X.
-
The degree of satisfies , where denotes the partial degree of with respect to the variables .
-
For any point such that , the specialized polynomial is generically non-vanishing over . (The proof is provided in Appendix B).
III. MDS VARIETIES AND HALF-SINGLETON OPTIMALITY
In this section, we prove that an irreducible variety is HS-optimal if and only if it is MDS. In other words, generic points on such a variety generate a code that is optimal with respect to both the Singleton bound for substitution errors and the half-Singleton bound for insdel errors.
A. Half-Singleton Optimality on Varieties
We begin by formally defining the MDS property for varieties.
Definition III.1 (MDS variety). Let be an algebraically closed field, and let be an irreducible variety. We say that is an MDS variety if, for every , a generic matrix with columns in generates an MDS code.
Remark III.1. The statement “ generically has a property” means that there exists a nonempty Zariski open subset such that the matrix has this property for every . Since is irreducible, so is , and every nonempty Zariski open subset of is dense. Equivalently, the exceptional tuples for which the property fails are contained in a proper Zariski closed subset of . Thus, the columns of are viewed as independent generic points of .
Geometrically, the MDS property can be characterized by hyperplanes passing through the origin: a matrix formed by generic points of the variety has full row rank precisely when the variety is not contained in such a hyperplane.
Lemma III.2. Let be an irreducible variety. Then the following statements are equivalent:
(a) For every , a generic matrix G with columns in X has full row rank.
(b) X is MDS.
(c) X is not contained in any hyperplane passing through the origin.
Proof. The equivalence between Item (b) and Item (c) is shown by Theorem 12 in [28]. Item (a) follows from Item (b) by the definition of MDS varieties.
To show that Item (a) implies Item (c), suppose for the sake of contradiction that is contained in the hyperplane , where is a non-zero vector. Then for any matrix with columns in , we have . This implies the rows of are linearly dependent, contradicting the fact that has full row rank.
Recall from Section II that the presence of the all-one vector 1 dictates whether a code can achieve the standard half-Singleton bound or the strict half-Singleton bound. The following lemma translates this algebraic condition into a geometric one, showing that depends entirely on whether the variety X is contained in an affine hyperplane.
Lemma III.3. Let be an irreducible MDS variety, and let . For a generic tuple , the code generated by contains 1 if and only if is contained in an affine hyperplane.
Proof. If is contained in an affine hyperplane, then by Lemma III.2, this hyperplane does not pass through the origin. Therefore, it can be written as for some . Then for every tuple , we have
Conversely, suppose is not contained in any affine hyperplane. Thus its affine span is the entire space . Therefore, a choice of generic points will also have an affine span of dimension . If the code contained the all-one vector , there would exist some such that . This implies that for all , meaning all points lie on the affine hyperplane defined by . However, because the affine span of generic points is , they cannot be contained in a -dimensional affine hyperplane. Thus, there is no such that , meaning generically.
We now define HS-optimality for varieties.
Definition III.4. Let be an algebraically closed field, and let be an irreducible variety. We say that is HS-optimal if, for every integer , a generic matrix with columns in generates an code that
• contains the all-one codeword 1 and can correct insdel errors; or
• does not contain the all-one codeword and can correct insdel errors.
We now state the main result of this section: for irreducible varieties, the MDS property is equivalent to HS-optimality.
Theorem III.5. Let be an algebraically closed field, and let be an irreducible variety. Then is an MDS variety if and only if it is an HS-optimal variety.
Proof overview: The direction from HS-optimality to the MDS property is immediate. If is not an MDS variety, then by Lemma III.2, a matrix formed by generic points of does not have full row rank and therefore does not generate an code.
For the converse, suppose that is an MDS variety. We need to prove that the verification matrices are generically nonsingular. The proof proceeds through three steps. First, in Section III-B, Lemma II.11 translates generic non-vanishing on into non-vanishing of formal power series. Second, in Section III-C, we reduce the resulting multivariate power series to univariate monomials. Finally, in Section III-D, we prove the required determinant conditions for these monomials. Applying the reductions in reverse proves the result for generic points on .
B. Reduction to Power Series
In this subsection, we formalize the first step of our reduction by translating the geometric properties of varieties into algebraic conditions on formal power series. Recall that a formal power series ring over a field in variables , denoted by , is a generalization of a polynomial ring that allows for infinite sums of monomials. Rather than evaluating these series at specific numerical points, we treat them as formal algebraic objects where properties like linear independence are determined by their coefficients.
Definition III.6. Let be an algebraically closed field. Given a -tuple of power series , we define the matrix as:
where , , are distinct -tuples of variables. Each entry in is an element in the formal power series ring.
Definition III.7 (MDS power series). A tuple of power series is said to be MDS if the following determinant is nonzero:
Lemma III.8 (Lemma 8 in [28]). A k-tuple is MDS if and only if are linearly independent as power series over .
Definition III.9 (HS-optimal power series). Let . We say that is HS-optimal if, for every , the following condition holds:
• If , apply an invertible row transformation and assume that . Write . Then, for all increasing subsequences satisfying ,
• If , then, for all increasing subsequences satisfying ,
Every HS-optimal tuple is MDS. Indeed, if are linearly dependent, then the rows of each corresponding verification matrix would be linearly dependent, contradicting its nonzero determinant.
Lemma III.10. Every MDS tuple is HS-optimal.
The first reduction: Assume Lemma III.10. Let be an irreducible MDS variety, and let be the tuple given by Lemma II.11. The polynomial is generically nonzero on . By Lemma II.11, is nonzero, and hence is MDS.
We next distinguish the two cases in Definition III.9. If is contained in an affine hyperplane, then by Lemma III.2, it is contained in a hyperplane . The polynomial vanishes on , so Lemma II.11 gives . Thus, . Conversely, if for some , then the same lemma implies that vanishes on , and hence is contained in an affine hyperplane.
By Lemma III.10, the tuple is HS-optimal. Applying Lemma II.11 to each verification determinant shows that it is generically nonzero on . Therefore, is HS-optimal, which proves the nontrivial direction of Theorem III.5.
C. Reduction of Power Series to Univariate Monomials
In the previous subsection, we established that proving Lemma III.10 is sufficient to prove our main result, Theorem III.5. In this subsection, we reduce Lemma III.10 to a base case involving univariate monomials. We first use an auxiliary variable to retain suitable leading monomials of the power series. Since only finitely many monomials remain, we then encode the multivariate monomials as univariate ones.
For a multi-index , we denote the multivariate monomial by . By treating the -tuple as a column vector of power series, we can expand it as
where is a coefficient column vector whose i-th entry is the coefficient of in .
Fix a graded lexicographic order on and use the same order for the corresponding monomials , . Under this ordering, if is an MDS tuple, we can identify its linearly independent leading terms.
Lemma III.11 (Lemma 7 in [28]). Let be a linearly independent tuple, and write . There exist multi-indices such that the coefficient vectors are linearly independent and, for every and every ,
where the span is when .
After an invertible row transformation, we may therefore assume that are the standard basis vectors. It follows that is the leading monomial of the -th transformed series for every .
This allows us to reduce the problem to monomials. The strict case requires a small additional argument because the constant terms need not vanish even though the constant series does not lie in the span of the tuple.
Lemma III.12. Suppose that the following tuples are HS-optimal in their respective cases:
• for all distinct positive integers ;
• for all distinct positive integers .
Then Lemma III.10 holds.
Proof. Let be an MDS tuple. Then the components are linearly independent. We apply Lemma III.11 to identify the leading multi-indices . As discussed above, we may apply an invertible change of basis to the span of so that the corresponding leading coefficient vectors become the standard basis vectors. Following this transformation, the leading term of the -th component is exactly the monomial .
We now employ a weighted substitution to map these multivariate power series to univariate ones while preserving their leading terms. For a positive integer vector , define the weight of by
Write and let . Since the graded lexicographic order first compares total degrees and only finitely many monomials have degree at most , we may choose so that every has smaller weight than all the later monomials appearing in . Indeed, first choose weights that preserve the lexicographic order among monomials of the same degree at most , and then add the same sufficiently large integer to all the weights. This leaves comparisons within the same degree unchanged and ensures that every monomial whose degree exceeds has weight larger than , for every . For each , where , substitute
Under this map, becomes . Let . The weights are chosen so that . If denotes the tuple obtained from by this substitution, then its -th component has the form
Suppose first that . Choose and let the other basis elements have zero constant term. Applying the preceding leading-term construction to this basis gives . For fixed increasing subsequences with , let be the corresponding verification determinant:
Let be the determinant obtained from by the above substitution. To isolate the leading monomials, replace every with , where is a formal variable. Factoring out from the two rows associated with , for every , gives
By the first assumption, the leading determinant is nonzero. Thus, is nonzero. Since it is obtained from by specialization, the original determinant is also nonzero.
If , the same argument applies to the strict verification determinant. When all constant terms vanish, its lowest-degree coefficient in is the strict verification determinant for , which is nonzero by the second assumption. Otherwise, choose a leading-term basis in which one element has constant term 1 and the others have zero constant term, and let be the smallest exponent of a nonconstant term in that element after substitution. Subtract its upper row from the corresponding lower row. After interchanging and if necessary, choose ; after the same substitution and scaling, the coefficient of in the resulting leading determinant is a standard verification determinant for , where are the positive leading exponents of the remaining basis elements. It is therefore nonzero by the first assumption. Hence the strict verification determinant is nonzero in both cases, completing the proof.
D. Monomial Codes
We now verify the base case of our reduction: codes generated by univariate monomials. This family includes the generalized Reed-Solomon codes.
Definition III.13 (Generic Reed-Solomon Code, [32]). Let be an arbitrary field. For a positive integer , let be algebraically independent variables, and let be the field of fractions of the polynomial ring . A generic Reed-Solomon code is the subspace generated by the matrix
Remark III.2. The variables represent generic evaluation points. By substituting these variables with specific, distinct elements from a finite field, one recovers a standard Reed-Solomon code.
In their foundational work, Con, Shpilka, and Tamo [25] analyzed the verification matrices of generic Reed-Solomon codes. Specifically, as detailed in the extended preprint of their paper, they demonstrated a crucial algebraic property: if a code is generated by the matrix (1) and the elements are treated as formal variables, then for any two increasing subsequences agreeing on at most coordinates, the determinant of the corresponding verification matrix is nonzero as a polynomial. By combining this non-vanishing determinant property with the rank condition established in Lemma II.9, we immediately obtain the following consequence.
Lemma III.14. A generic Reed-Solomon code is HS-optimal
We now extend this result to monomial codes, where the generators are arbitrary distinct monomials rather than consecutive powers . This generalization is necessary because the reduction in Section III-C produces non-consecutive exponents.
Lemma III.15. Let and let be integers. Let be generic points. Consider the code generated by the matrix
If , this code is HS-optimal. If , it is strict HS-optimal.
Proof. We first prove the standard case . Since the are algebraically independent, every generalized Vandermonde determinant formed by columns of is nonzero. Thus, if and only if . By Lemma II.9, it suffices to prove that the standard verification determinant is nonzero whenever satisfy .
We proceed by induction on . For , the verification matrix is (1), so its determinant is nonzero. Now suppose . If , choose a position with and a position such that . If , choose different positions such that and . Delete positions and from both sequences to obtain . By construction, .
Consider the coefficient of in . These factors must be selected from the two rows corresponding to and columns , respectively. Hence this coefficient, up to sign, is
which is nonzero by the induction hypothesis. Therefore, , and the code is HS-optimal.
The case follows similarly, using the strict verification matrix.
Proof of Theorem III.5. Suppose first that X is HS-optimal. By definition, a matrix formed by generic points of X has full row rank. Hence X is not contained in a hyperplane passing through the origin, and Lemma III.2 implies that X is MDS.
Conversely, suppose that is MDS. The zero-dimensional case is immediate, since an MDS point can occur only when . We may therefore assume that has positive dimension. By Lemma III.15, univariate monomial tuples satisfy the required verification determinant conditions in both cases: the standard case when and the strict case when . Applying Lemma III.12 proves Lemma III.10. Finally, Lemma II.11 transfers the non-vanishing of these power series determinants back to generic points on . Therefore, is HS-optimal.
IV. PROBABILISTIC ANALYSIS OF RANDOM CODES ON MDS VARIETIES
In Section III, we established that codes generated by generic points on an irreducible MDS variety that is contained in an affine hyperplane are half-Singleton optimal. However, “generic points” inherently assume an infinite field, which is not realizable in practical storage or communication systems. To construct practical codes, we must restrict our attention to rational points over a finite field .
Our goal in this section is to prove that this optimal performance is asymptotically preserved with high probability, when the columns of the generator matrix are sampled uniformly from the rational points . We first develop a general probabilistic framework and state the main theorem, and then provide detailed estimates for the relevant failure probabilities. In the standard case, when is contained in an affine hyperplane, we may normalize this hyperplane to by an invertible change of coordinates, which preserves all rank conditions. In the strict case, is not contained in any affine hyperplane, so no such normalization is made.
A. Probabilistic Analysis of Random Codes
Let be an irreducible MDS variety contained in an affine hyperplane, and let be a set of -rational points on . Let be a matrix whose columns are sampled uniformly and without replacement from .
Fix . We are going to show that with high probability, the code generated by is -relaxed HS-optimal. Denote
By Lemma II.9, the code fails to be -relaxed HS-optimal if there exists a pair of increasing subsequences of length such that
-
, and
-
the verification matrix fails to have full row rank.
To analyze this failure probability, we introduce three parameters:
We will use the following parameter inequality below:
Lemma IV.1. Assume that . For all sufficiently large , the parameters in (2), together with , satisfy (3).
Proof. Since and , and since , we have and . Therefore,
The last expression is positive for all sufficiently large n, which proves (3).
The following lemma estimates the probability that verification matrix fails to have full row rank; its proof is deferred to Section IV-B.
Lemma IV.2. Let be an irreducible MDS variety contained in an affine hyperplane, and let satisfy . Fix , set and , and define , , and as in (2). Assume that and is sufficiently large. Let satisfy , and let be fixed increasing subsequences with . If the columns of are sampled uniformly without replacement from , then the probability that fails to have full row rank is at most
where denotes the maximum number of -rational points on X that can lie in the zero set of a polynomial with coefficients in , of degree at most d, and generically non-vanishing on X.
For , let denote the probability that a matrix whose columns are sampled uniformly without replacement from S fails to have full row rank k.
Theorem IV.3. Let , , and the parameters , , , and be as in Lemma IV.2. Let be a matrix with columns sampled uniformly and without replacement from . Then the code generated by is -relaxed HS-optimal with probability at least
Proof. Let denote the failure event that the code is not -relaxed HS-optimal. For any fixed pair of increasing subsequences , let be the event that , and let be the event that the verification matrix fails to have full row rank . If , then both and occur for every pair , so this case is already included in the union of failure events below and requires no separate treatment.
By Lemma II.9, the failure event occurs only if both and occur for at least one pair . Therefore,
Throughout the proof, and range over increasing subsequences in . Partition their pairs into
Applying the union bound gives
For any pair , Lemma IV.2 directly bounds , yielding:
For any pair , set . Since , we have . Delete from both subsequences the same positions on which they agree, and denote the resulting subsequences by and . Their length is , and . Let be the event that fails to have full row rank . The shortened matrix is obtained from the original matrix by deleting columns, so . Therefore, Lemma IV.2 applies to and gives the same probability bound as in Case 1.
The total number of possible sequence pairs in is bounded by , and the number of pairs in is similarly bounded by . Applying the union bound to and separately, the combined failure probability for the first two cases is:
For any pair , we bound the joint probability by the marginal probability of the intersection rank failing: . Because , the event implies that any subset of columns chosen from this intersection must also fail to achieve full rank . This probability is bounded above by the probability that a random submatrix sampled from is singular. Thus:
Applying the union bound over all at most possible pairs in yields the final term . Adding this to the previous sum bounds the total failure probability . The probability that the code succeeds is , which yields the stated bound and completes the proof.
For curves, Bezout's theorem gives explicit bounds for both and the rank failure probability , leading to the following specialization of Theorem IV.3.
Lemma IV.4 (Bezout's theorem). Let be an algebraic curve of degree . If is a polynomial of degree that is generically non-vanishing on , then has at most zeros on .
Corollary IV.5. Under the assumptions of Theorem IV.3, suppose in addition that X is an affine curve of degree d. Then the code generated by G is -relaxed HS-optimal with probability at least
Moreover, if , the probability is at least
Proof. First, we bound the geometric parameter . Since X is an irreducible curve of degree d, by Lemma IV.4, a polynomial of degree 2 that does not vanish identically on X has at most 2d zeros on X. Hence,
Second, we bound the rank failure probability . If a matrix fails to have full row rank, its columns lie in a hyperplane through the origin. Since the MDS curve is not contained in such a hyperplane, Lemma IV.4 gives . For a fixed , expose the sampled points one at a time. If the first points all lie in , then the conditional probability that the next point also lies in is at most
Multiplying these conditional probabilities, the probability that all sampled points lie in is at most .
There are hyperplanes through the origin in . Taking and applying the union bound gives
Combining these estimates yields the stated probability bound.
If , no hyperplane can contain distinct points. Thus, trivially.
B. Chain Decomposition and Rank Certification
In this subsection, we prove Lemma IV.2 using the rank-certification framework of Con, Guo, Li, and Zhang [26]. For fixed increasing subsequences I and J, the framework decomposes them into small, mutually disjoint chains that cover most of their positions and describe the local relations between the two subsequences. The chains are divided into a primary queue and a reserve bank. The algorithm examines the chains in order and tests whether each one certifies generic non-vanishing of the relevant determinant after the previously exposed variables have been specialized. If a test fails, the current chain is discarded and replaced by a fresh chain from the reserve bank. Consequently, if the rank certification ultimately fails, the algorithm must record a prescribed number of failed chain tests.
The probability estimate follows by exposing the chains one at a time. Because the chains are disjoint, the variables in a fresh chain have not been exposed before and are sampled uniformly from the remaining points of . For a fixed sequence of failed tests, the generic non-vanishing of the determinant and the degree bound in each column allow us to control the conditional probability that each new chain fails in terms of . Multiplying these conditional bounds gives an upper bound for the probability of the prescribed failure sequence. A union bound over all possible failure sequences and all pairs then gives the probability estimate in Lemma IV.2. Our argument follows the general chain-decomposition and replacement strategy of [26], adapted to codes obtained from points on an MDS variety. In this setting, the relevant failure probability is controlled through by bounding the rational points of at which a specialization can fail, rather than by counting bad evaluation points in the Reed-Solomon setting.
We now introduce the definitions needed for the chain decomposition.
Definition IV.6 (Subsequence Selection). For an increasing subsequence and with , denote by the increasing subsequence .
The fundamental unit of our analysis is the chain, which captures the local coupling between two subsequences.
Definition IV.7 (Chain). Let be two increasing subsequences. We say the pair is a chain if one of the following conditions holds:
• Type I: and
• Type II: and either for all , or for all .
For the replacement procedure, we need chains that do not share variables.
Definition IV.8 (Indices of variables). For increasing subsequences and subset , we define the set of variable indices involved in the block corresponding to as:
Definition IV.9 ((I, J)-disjointness). Let be increasing subsequences. Two sets are said to be -disjoint if the sets of variables and are disjoint.
The following result gives disjoint chains of bounded size.
Lemma IV.10 ( [26], Lemma 30). Let be increasing subsequences. Let . Then there exist a subset of size at least and a partition into nonempty sets, where denotes a disjoint union, such that
-
Each is a chain.
-
The sets are mutually -disjoint.
-
for every .
Permute , if necessary, so that and all Type I chains precede the Type II chains. Thus, if and is Type I, then is also Type I. This ordering ensures that a chain taken from the bank is at least as large as the chain it replaces.
We now explain the role of Eq. (3). The chains retained by Lemma IV.10 contain at least positions. We reserve the last chains as a bank, choosing so that their total size first reaches . The next lemma shows that the bank contains enough chains for possible replacements, while the remaining chains still contain enough positions to form the required verification columns.
Lemma IV.11. For the fixed parameters above and all sufficiently large n, there exists an index such that
Furthermore, the remaining chains satisfy
and we have .
Proof. Since , the chains cover at least positions. Thus, Eq. (3) ensures that their total size exceeds . Choose the last chains greedily until their total size first reaches . Since each chain has size at most , the selected total lies in . Consequently,
Moreover, the selected chains have total size at most , so their total size being at least implies .
To construct our verification framework, we must define the specific submatrices that the algorithm will evaluate.
Definition IV.12. Let , let be increasing subsequences, and let be a matrix. Let be pairwise disjoint nonempty sets such that each is a chain. Define the corresponding block matrix by horizontal concatenation:
Lemma IV.13. Under the notation of Definition IV.12, if has full row rank, then also has full row rank.
Proof. The block matrix is obtained from by selecting and possibly reordering columns. Hence its row rank cannot exceed that of .
We now give the rank-certification procedure. Its pseudocode is presented in Algorithm 1. We subsequently explain its initialization, chain verification, and termination.
The algorithm has three steps:
- Initialization: Choose m as in Line 3. The first s - m chains form the primary queue, and the last m chains form the bank used for replacements.
Algorithm 1: Rank Certification Procedure
Input: , , an irreducible variety contained in an affine hyperplane, , , increasing subsequences , and ordered sets obtained from Lemma IV.10.
Output: “SUCCESS” or a sequence .
1 . // set of indices of assigned variables 2 . // number of assigned columns 3 Pick the smallest such that . // last chains form the bank 4 . // current chain to assign 5 . // current chain in the bank 6 . // number of failed attempts 7 for to do . 8 while do 9 the determinant of the left submatrix of . 10 . 11 . // assign the variables in the -th chain 12 if is generically non-vanishing in the remaining variables then 13 . 14 . 15 . 16 else // replace the -th chain by (part of) the -th chain in the bank 17 set of the smallest elements in . 18 . 19 . 20 . 21 . 22 if then output and halt. 23 end 24 end 25 Output “SUCCESS”.
-
Chain verification: For the current chain , specialize for every and test whether the chosen determinant is generically non-vanishing in the remaining variables (Lines 9-12). If the test succeeds, the algorithm accepts this chain, increases by the number of verification columns in its block, and advances to the next chain. If the test fails, the specialized determinant is identically zero in the remaining variables; the algorithm records and replaces by a chain of the same size taken from the bank (Lines 17-22).
-
Termination: The algorithm outputs “SUCCESS” once . If the number of failed tests reaches r first, it outputs .
The algorithm above is the transpose analogue of the rank-certification algorithm in [26]. There, the relevant matrix has one row for each position , whose entries are the powers of the scalar variables and , and the algorithm assigns these scalar variables chain by chain. Here, has one column for each position , formed from the vector variables and ; these generator-matrix columns are points of X. Thus, our procedure successively assigns columns and considers the left submatrix, whereas [26] assigns the and considers the top submatrix. Apart from this transposition and the different variables being assigned, the chain decomposition, determinant checks, and replacement steps are the same.
The correctness of Algorithm 1 follows from the remaining properties below. They depend only on the sequence indices, so their proofs use the same combinatorial arguments as in [26].
The following lemma verifies the validity of the steps of Algorithm 1 after its initialization. In particular, Item (b) ensures that Line 9 is valid, while Items (d) and (e) ensures that Lines 17-18 are valid.
Lemma IV.14. During Algorithm 1, after Line 7:
(a) for . In particular, for .
(b) .
(c) always holds at Line 9.
(d) always holds at Line 9.
(e) always holds at Line 9, and consequently, also at Line 17.
Proof Sketch. These invariants hold dynamically because the algorithm only ever shrinks or discards chains during replacements. In particular, the inequality follows from the initial ordering of the chains by size: chains taken from the bank, indexed by b, are always at least as large as the corresponding chains in the primary queue, indexed by a.
Lemma IV.15. Algorithm 1 terminates, outputting either “SUCCESS” or a sequence . In the former case, the specialized matrix has full row rank.
Proof Sketch. The variable records the number of assigned columns and strictly increases after each successful assignment, namely, when is generically non-vanishing in the remaining variables. If reaches , then all variables involved in the chosen minor have been assigned and the resulting value of is nonzero. Hence, contains a nonsingular submatrix and therefore has full row rank. On the other hand, whenever the rank-certification step fails to progress, the failure counter strictly increases; thus the algorithm must terminate once reaches the prescribed budget .
As the variable c in Algorithm 1 never decreases, we have the following lemma.
Lemma IV.16. Any sequence output by Algorithm 1 satisfies .
Recall that denotes the set of variable indices involved in .
Lemma IV.17. The sets are mutually -disjoint before and after the replacement operations in Lines 17-18.
Proof Sketch. They are initially disjoint by the chain decomposition theorem. Each replacement uses a subset of a fresh bank chain, which is disjoint from all chains currently in use, so disjointness is preserved.
Lemma IV.18. At Line 9 of Algorithm 1, none of the points indexed by has been exposed in a previous iteration of the while loop. In particular, none of these indices has previously been added to .
Proof Sketch. This follows directly from Lemma IV.17: once a chain is evaluated, it is either accepted or discarded, and the next chain considered is disjoint from all previously used chains. Hence all points indexed by are unexposed.
The following lemma is a key ingredient in the analysis. It shows that, once , the failure sequence , and the current value of are fixed, the combinatorial state of the algorithm is determined independently of the actual values of .
Lemma IV.19. At Line 12 of Algorithm 1, the values of and a are determined by the values of , , and , together with the input excluding .
Proof Sketch. The pointers and , as well as the queues , are updated solely according to the outcomes of the determinant checks. More precisely, a successful check increases and advances , while a failed check records the current value of , replaces the current queue by a prescribed subset of the next bank queue, and advances . Therefore, once the previous failure sequence and the current value of are fixed, the entire combinatorial state of the algorithm is fixed as well. This state depends only on the input combinatorial data and not on the actual values of . For a detailed proof, we refer the reader to [26, Proof of Lemma 39].
We now justify the algebraic verification step. We first give a simple degree bound for the determinants of the relevant minors.
Lemma IV.20. Let be an irreducible MDS variety contained in an affine hyperplane, and set . Let be increasing subsequences that agree on at most coordinates. For every subset of size , the determinant
is generically non-vanishing when its column variables are chosen from X. Moreover, its degree in each column variable is at most 2.
Proof. By Theorem III.5, the MDS variety is HS-optimal. Since is contained in an affine hyperplane and agree on at most coordinates, HS-optimality gives the generic non-vanishing of .
A fixed generator column occurs in the verification matrix at most twice: once through and once through . The determinant is multilinear in the columns of the verification matrix, so its degree in the entries of is at most 2.
We next show that the determinant remains generically non-vanishing after a chain is replaced.
Lemma IV.21. At Line 12 of Algorithm 1, the determinant for , viewed as a polynomial in the unassigned column variables , , is generically non-vanishing when these variables range over .
Proof. The proof follows the re-indetermination argument in [26, Proof of Lemma 40]. We argue by induction on the iterations of the while loop. In the first iteration, . Up to a permutation of columns, is the determinant of a matrix of the form for some of size . By Lemma IV.20, this determinant is generically non-vanishing.
Suppose that, at Line 12 in a given iteration, the partially specialized determinant is generically non-vanishing in the remaining variables. If the test at Line 12 succeeds, then the algorithm replaces by
and the test itself asserts that the resulting determinant is generically non-vanishing. Thus, the same property holds in the next iteration.
It remains to consider the case in which the test fails. Then is unchanged, but the current chain is replaced by a subset of a fresh bank chain. By Lemma IV.18, none of the variables indexed by or has been assigned before. Let and denote the partially specialized determinants before and after this replacement, respectively.
The two determinants differ only in the block corresponding to the replaced chain. As in [26, Proof of Lemma 40], there are three cases: the two chains are Type II with the same orientation, the two chains are Type II with opposite orientations, or the old chain is Type I. In the first case, the old block is obtained from the new block by relabeling the fresh column variables. In the second case, the same holds after reversing the order of the new chain, which only permutes columns and therefore changes the determinant by a sign. In the Type I case, the same conclusion follows by identifying the two variables in the new block with the single variable in the old Type I block. Finally, the ordering of the chains implies that, if the new bank chain is Type I, then the old chain is also Type I. Hence these cases cover all possibilities.
Consequently, there exists a relabeling homomorphism of the remaining column variables, possibly together with a column permutation, such that . If were identically zero on the product of the remaining copies of X, then so would be , contradicting the induction hypothesis. Thus, is generically non-vanishing. The invariant is therefore preserved at every iteration, which proves the lemma.
We now combine these algebraic guarantees with the geometric density parameter to bound the probability of a specific failure sequence. This allows us to formally prove the fundamental bound introduced in Section IV-A.
Proof of Lemma IV.2. By Lemma IV.15, if the matrix fails to achieve full row rank, Algorithm 1 must output a sequence . Let
For , let be the event that the algorithm matches a fixed target sequence up to the -th index. We prove by induction that .
For , the claim holds trivially. Assume the bound holds for some . We now prove that it holds for as well. Denote the fixed target sequence by . Let be the sub-event of that the algorithm reaches Line 12 with , , and . Note that is a sub-event of . If , then and the step is proven. Otherwise, by the inductive hypothesis, . It therefore suffices to bound the conditional probability .
Condition on the event . Consider the moment when the algorithm reaches Line 12 with , , and . By Lemma IV.19, and the index are entirely determined. The set of assigned variables is also determined.
Let be the set of all point indices exposed before the current test, including those in discarded chains. Here, the exposed points include those in chains accepted in previous iterations and those in chains discarded after failed tests. Further condition on arbitrary values of , , that are consistent with . By Lemma IV.18, is disjoint from . Therefore, conditioned on these previously exposed values, the points indexed by are sampled uniformly without replacement from the remaining points of . The following bound is uniform over all choices of the conditioned values, so it also holds after averaging over them.
Let . After the current chain is exposed, the determinant tested at Line 12 is the polynomial in the other unassigned column variables. By Lemma IV.21, is generically non-vanishing. List the indices in as . Since is a chain, . Moreover, by Lemma IV.20, has degree at most 2 in each column variable .
Expose one at a time. Before exposing , apply Lemma II.12 with as the first group of variables and all remaining unassigned columns as the second group. As long as the previous specializations preserve generic non-vanishing, this gives a polynomial on that is generically non-vanishing and has degree at most 2. If , specializing again preserves generic non-vanishing. Conditioned on the previously exposed points, is uniform over at least available points. Hence the probability that this specialization fails is at most
If every specialization preserves generic non-vanishing, then remains generically non-vanishing in the other unassigned column variables. Therefore, for to be identically zero, at least one of these specializations must fail. A union bound over the exposed points therefore gives
The event requires this test to fail, so , completing the induction.
By Lemma IV.15, if the matrix does not have full row rank, then Algorithm 1 outputs a sequence . By Lemma IV.16, any output sequence satisfies . The number of such sequences is . Using the union bound on all such sequences, the failure probability is at most
V. APPLICATION TO AG CODES
We now apply our probabilistic framework to algebraic geometry codes constructed from curves over finite fields. After recalling the standard construction of AG codes, we show that their generator matrices can be viewed as matrices whose columns are sampled from an affine MDS curve. This allows us to apply the probabilistic bounds from Theorem IV.3 and Corollary IV.5 and derive explicit results for several families of curves.
To define algebraic geometry codes, we use projective varieties. Let denote the -dimensional projective space over , whose points are written in homogeneous coordinates , where two nonzero vectors define the same point if they differ by a nonzero scalar multiple. A projective variety in is the common zero set of homogeneous polynomials in , or equivalently, the zero set of a homogeneous ideal.
Every affine variety can be embedded into projective space by the standard map
The projective closure of , denoted by , is the Zariski closure of this image in . Concretely, if is defined by polynomials in , then is obtained by homogenizing these defining equations with respect to . The points in are called points at infinity.
We briefly recall the standard setup for AG codes. An algebraic curve is an irreducible variety of dimension 1. It is smooth if all its points are non-singular, and complete if it is proper (in the case of curves, this is equivalent to being a projective variety). In this section, let be a smooth complete geometrically irreducible curve of genus defined over , and let denote its function field.
Divisors and Riemann-Roch spaces can be defined over arbitrary fields, and their geometric properties are often studied after extending the base field to an algebraic closure. Here, however, our goal is to construct AG codes over . We therefore work with divisors defined over and define their Riemann-Roch spaces using rational functions in . We pass to only when viewing the generator-matrix columns as points on an algebraic variety.
For a rational function and a point , the discrete valuation of at , denoted by , is defined as the order of the zero (if positive) or pole (if negative) of at .
A divisor on is a formal finite sum of the form , where and . A divisor is said to be defined over if it is invariant under the Frobenius automorphism. Throughout this section, all divisors are assumed to be defined over . The set of divisors on is denoted by . The support of , denoted by , is the set . Its degree is . If every coefficient is non-negative, then is called an effective divisor, denoted by .
For a nonzero rational function , its principal divisor is . The Riemann-Roch space associated with a divisor is
It is a finite-dimensional vector space over , whose dimension is denoted by . The Riemann-Roch theorem also applies to divisors defined over and to the -vector spaces considered here.
Lemma V.1 (Proposition 1.3.4 in Chapter IV, [33]). Let be a smooth complete curve of genus , and let be a divisor on . If , then .
Let be a tuple of distinct -rational points on such that and . The evaluation map
defines the AG code as its image. Its kernel is . This space is zero because : a nonzero function in this space would make an effective divisor. Since every principal divisor has degree zero, this effective divisor would have negative degree, which is impossible. Hence the evaluation map is injective, and is an linear code with .
Lemma V.2. Write and let . If , then if and only if is effective.
Proof. If is effective, then , so its evaluation is 1. Conversely, suppose that evaluates to 1, and set . The poles of are bounded by , and vanishes at . Hence
where the equality follows from . Thus . Since , the divisor is effective.
For simplicity, we restrict to one-point divisors of the form , where and is a non-negative integer. This restriction is sufficient for our purposes, since one-point divisors already provide the families of AG codes needed for the results below; no optimization over the choice of divisor is required.
To connect this standard construction to the analysis in Section IV, we show that can be realized directly as a code generated by sampling points from an affine curve defined over .
Lemma V.3. Let be a smooth complete curve of genus defined over , let , and let with . Set and choose a basis of . Then the map
has image an irreducible MDS affine curve of degree . For every tuple of distinct points in , the vectors are the columns of a generator matrix of . Moreover, for every , the map gives a bijection from to . Thus, sampling points uniformly without replacement from is equivalent to sampling columns uniformly without replacement from .
The proof uses standard results about embeddings defined by linear systems; for completeness, we give the details in Appendix C.
Because Lemma V.3 realizes these AG codes as codes generated by points on an irreducible MDS affine curve, Theorem III.5 gives the following consequence.
Corollary V.4. Under the assumptions of Lemma V.3, let . For a generic tuple of evaluation points , the code is HS-optimal.
We now apply the probabilistic bound from Corollary IV.5 to AG codes.
Theorem V.5. Let be a smooth complete curve of genus defined over , let , and let with . Set , and let satisfy . Fix , set , and define as in (2). Suppose that , , , and is sufficiently large. Let be sampled uniformly without replacement from . Then is -relaxed HS-optimal with probability at least
Proof. By Lemma V.3, the chosen basis of gives an irreducible MDS affine curve of degree . It also gives a bijection between and under which the sampled points become the columns of a generator matrix of . In particular, sampling from is equivalent to sampling columns uniformly without replacement from .
Since , it is contained in an affine hyperplane. All the assumptions of Theorem IV.3, and hence of Corollary IV.5, are therefore satisfied for and . Finally,
where the strict inequality follows from . The second bound in Corollary IV.5 now gives the stated probability. Notice that the argument applies the corollary directly to Y; no comparison between the parameters and is needed.
The probability bound in Theorem V.5 depends on the ratio , while its degree condition requires . Since , we need curves whose genus is not too large relative to the block length and that still provide many more than n rational points for sampling. The ratio measures this tradeoff between the available evaluation points and the genus. We first recall the Serre bound:
Lemma V.6 (Serre bound). Let be the number of rational points on a smooth complete curve of genus over . Then
When is a square, curves attaining the Hasse-Weil upper bound are called maximal curves.
For fixed genus , the Serre bound gives . This allows a linear field size to provide enough sampling points for the following result.
Theorem V.7. Fix a rational rate , then fix and a non-negative integer . For all sufficiently large such that is an integer, let be a prime power satisfying
Let be a smooth complete curve of genus defined over , and fix . Set and . If is sampled uniformly without replacement from , then has rate and is -relaxed HS-optimal with probability at least .
Proof. The choice of and the Riemann-Roch theorem give
so the code has rate . Since is fixed, for all sufficiently large we have , , , , and . Thus, all assumptions of Theorem V.5 hold.
By Lemma V.6, . For all sufficiently large n, the assumptions on q and the fixed value of g imply
Consequently, and
Let denote the failure-probability bound in Theorem V.5. Since and , the preceding estimate gives
for all sufficiently large n, where the last inequality uses . Thus , as claimed.
By taking to be the smallest prime power greater than the displayed lower bound, we can ensure that .
Example 1 (Reed-Solomon Codes). Let over , and let be its unique point at infinity. The Riemann-Roch space consists of the polynomials of degree at most . Therefore, evaluating this space at distinct points of gives an Reed-Solomon code. Equivalently, when , this code is obtained by puncturing the full-length Reed-Solomon code. Thus Theorem V.7 shows that, for , a random punctured Reed-Solomon code is -relaxed HS-optimal with high probability, as also proved in [26].
We now examine specific families of curves that allow for smaller field sizes.
a) Sublinear Fields via Hermitian Curves: Let be a square prime power. We denote by the smooth projective model over of the affine Hermitian curve
Its genus is
and it has rational points over . The curve has a unique point at infinity, denoted by . A one-point Hermitian code is an AG code of the form
where the evaluation points in are chosen from . We show that random punctured Hermitian codes are -relaxed HS-optimal with high probability when .
Theorem V.8. Fix a rational rate , then fix . Set
For all sufficiently large n such that k = Rn is an integer, choose a square prime power q satisfying
Let be the Hermitian curve above, fix , and set and . If is sampled uniformly without replacement from , then has rate and is -relaxed HS-optimal with probability at least .
Proof. Such a always exists: take the smallest power of 4 greater than . The upper bound on gives . Hence, for all sufficiently large , we have , , , , and . Thus, all assumptions of Theorem V.5 hold. The Riemann-Roch theorem also gives , so the code has rate . Here . Since , we have
Moreover, , so for all sufficiently large . Therefore,
The final inequality follows from . Applying the same logarithmic estimate as in the proof of Theorem V.7 gives a failure probability at most .
b) Constant Field Sizes: The García-Stichtenoth Tower: For a fixed field size , the asymptotic behavior of the quotient is limited by the Drinfeld-Vlădut bound:
Lemma V.9 (Drinfeld-Vlădut bound). Let denote the maximum number of rational points on a smooth projective curve of genus over . The asymptotic quantity is defined and bounded as follows:
Let be a prime power and set . We use the first García-Stichtenoth tower over , which attains this bound [34]. Its function fields are defined recursively by
where
Let be the smooth complete curve over with function field . Its genus is
The curve has one -rational point at infinity and at least affine -rational points. Thus
Theorem V.10. Fix a rational rate , then fix . There exists a prime power
and an infinite family of random AG codes of rate over the fixed field , with lengths . For every sufficiently large , the code of length is -relaxed HS-optimal with probability at least .
Proof. Write R = a/b in lowest terms and set
Choose p to be the smallest power of 2 such that and
Since , this choice gives . For each level , set
Then is an integer, , and . Write . Let be the rational point at infinity of , and define
The genus formula gives . The choice of c implies, for all sufficiently large t, that
Indeed, the first two inequalities follow respectively from and , while the last follows from
Since , we have and for all sufficiently large . Thus, the remaining assumptions of Theorem V.5 hold. The Riemann-Roch theorem gives , so each code has rate .
For all sufficiently large , we have . Hence the rational-point bound for the tower gives
Moreover,
By the choice of p,
If is sampled uniformly without replacement from , applying the logarithmic estimate from the proof of Theorem V.7 shows that fails to be -relaxed HS-optimal with probability at most . Since is fixed, these codes form the claimed infinite family over .
APPENDIX A LEMMA II.5
Proof. For two different codewords ,
Thus
Suppose now that is HS-optimal. If , then , and hence
This contradicts . Thus . Moreover,
so is strict HS-optimal.
APPENDIX B LEMMA II.12
Proof. Let be the dimension of the irreducible variety . By applying Lemma II.11 to , there exist formal power series such that for any polynomial , is generically non-vanishing over if and only if the substituted series is non-zero in .
We can naturally view as a polynomial in whose coefficients are polynomials in . By substituting the variables with the corresponding power series , we obtain , which is a formal power series in the variables whose coefficients are polynomials in .
Observe that each of these new polynomial coefficients is formed strictly by evaluating the y-components of . Because substituting for y does not alter the x variables or increase their exponents, the total degree of any resulting coefficient polynomial is bounded by the maximum degree of x in the original polynomial . That is, the degree of any such coefficient polynomial is at most .
By the premise of the lemma, is generically non-vanishing over the product variety . If every single coefficient polynomial of our constructed power series vanished completely over , then for any generic point , the evaluated power series would be strictly zero. By Lemma II.11, this would imply that vanishes completely over for all generic points , directly contradicting the fact that is generically non-vanishing over .
Therefore, there must exist at least one specific coefficient polynomial in this series that is generically non-vanishing over X. We define our target polynomial to be this exact coefficient polynomial.
To conclude the proof, it remains to verify that satisfies the three stated conditions. By its very selection, is inherently generically non-vanishing over , and as established previously, its total degree is bounded by . Finally, let be any point such that . When evaluating the formal power series at , the term associated with remains strictly non-zero. This ensures that the entire evaluated series is non-zero. By Lemma II.11, this algebraic condition guarantees that the specialized polynomial is generically non-vanishing over , completing the proof.
APPENDIX C
DETAILS OF PROVING LEMMA V.3
To prove this lemma, we recall some algebraic geometric tools from [35]. Throughout this subsection, X is a smooth complete curve of genus g.
Degree of a map. Note that, if is a non-constant rational map, then is a field embedding. Since the fields and are of transcendence degree 1 over and are finitely generated, the degree of extension is finite; it is called the degree of the map and is denoted by .
a) Cartier divisors: Let , , and let be an open subset in . By we denote the following divisor on :
For any and any there exists an open set such that and is a principal divisor on , i.e., for some . Combining the fact that a projective curve is compact, for any there exists a finite open covering of such that . On the set , the function is regular and has no zeroes. Conversely, for any system , where is a finite open covering of , are rational functions, and , there is a unique divisor with . A system with these properties is called a Cartier divisor.
b) Functoriality: Using Cartier divisors, we can define the inverse image of a divisor under a regular map of smooth irreducible complete curves. Indeed, let be a Cartier divisor on , corresponding to . Then is defined on the covering of by the system of functions , where . One can easily check that defines a group homomorphism ; here, since for any .
Using Cartier divisors, for a curve we can also define the divisor of a form on . Indeed, put and , where and are homogeneous coordinates in . This system defines a Cartier divisor.
There is an equivalent definition of the degree of a curve. If is a linear form, then is called a hyperplane section divisor. All hyperplane section divisors are linearly equivalent and therefore have the same degree, which is the degree of . This agrees with the definition given above.
Next we are ready to introduce a fundamental lemma in algebraic geometry, showing that the number of points in the inverse image of a point with multiplicity is the degree of the map.
Lemma C.1 (Corollary 2.1.74, [35]). Let be two smooth projective curves, and let be a non-constant map. Then for any point we have
and for any divisor , we have
c) Embedding by linear systems: Let be a divisor on X and let . Taking a basis of , we can define a rational map
The map is regular on . For a point , choose a local parameter at , i.e. a function with . Let . By the definition of , . The map at is defined by
Since is the minimum valuation, at least one of the terms is non-zero and all are finite, so the point in is well-defined. Therefore is a regular map from to its image , which is a complete projective curve. Since are linearly independent, is not contained in a hyperplane .
A point is called a base point of the divisor if every function satisfies . is said to be a base point free divisor if there is no base point. Notice that if is base point free, there exists an such that . Thus the parameter we choose is exactly .
The Riemann-Roch theorem implies that if is large enough, the map is an embedding, i.e. defines an isomorphism of X onto C.
Lemma C.2 (Corollary 2.2.29, [35]). If , then is an embedding of in .
For , the preceding results show that , that D is base point free, and that is an embedding.
Finally we come to the proof of the lemma. It is easy to see that assuming the curve , the divisor and the Riemann-Roch space are defined over does not affect any of those previous propositions.
Proof of Lemma V.3. Because is effective, and we may choose the basis in the statement. By Lemma C.2, the associated map
is an embedding. At , let be a local parameter. Since , each is regular at , and since is base point free, these functions do not all vanish there. Hence
Because and d>0, the first coordinate of is zero. Thus is a point at infinity.
Let . The pullback of a hyperplane section of is linearly equivalent to . Since has degree 1, Lemma C.1 gives . The curve is irreducible and is not contained in a projective hyperplane, because are linearly independent.
Let and identify it with . Since , the restriction of to is
Since , its image is exactly . This is an irreducible affine curve whose projective closure is , so it has degree . Adjoining a first coordinate equal to 1 gives the curve
This affine embedding preserves the degree. Moreover, since is not contained in a projective hyperplane, a generic set of points of is linearly independent. Their affine lifts in are therefore linearly independent, so is an MDS curve.
For , the -th column of the generator matrix associated with the chosen basis is
Finally, is the restriction of an embedding and is defined over . Hence it maps every bijectively onto , and this bijection preserves uniform sampling without replacement.
REFERENCES
[1] V. Levenshtein, “Binary codes capable of correcting deletions, insertions, and reversals,” in Soviet physics-doklady, vol. 10, no. 8, 1966.
[2] G. Tenengolts, “Nonbinary codes, correcting single deletion or insertion (corresp.),” IEEE Transactions on Information Theory, vol. 30, no. 5, pp. 766–769, 1984.
[3] V. Guruswami and R. Li, “Efficiently decodable insertion/deletion codes for high-noise and high-rate regimes,” in 2016 IEEE International Symposium on Information Theory (ISIT). IEEE, 2016, pp. 620–624.
[4] J. Brakensiek, V. Guruswami, and S. Zbarsky, “Efficient low-redundancy codes for correcting multiple deletions,” IEEE Transactions on Information Theory, vol. 64, no. 5, pp. 3403–3410, 2017.
[5] C. Schoeny, A. Wachter-Zeh, R. Gabrys, and E. Yaakobi, “Codes correcting a burst of deletions or insertions,” IEEE Transactions on Information Theory, vol. 63, no. 4, pp. 1971–1985, 2017.
[6] V. Guruswami and C. Wang, “Deletion codes in the high-noise and high-rate regimes,” IEEE Transactions on Information Theory, vol. 63, no. 4, pp. 1961–1970, 2017.
[7] K. Cheng, Z. Jin, X. Li, and K. Wu, “Deterministic document exchange protocols, and almost optimal binary codes for edit errors,” in 2018 IEEE 59th Annual Symposium on Foundations of Computer Science (FOCS). IEEE, 2018, pp. 200–211.
[8] B. Haeupler, “Optimal document exchange and new codes for insertions and deletions,” in 2019 IEEE 60th Annual Symposium on Foundations of Computer Science (FOCS). IEEE, 2019, pp. 334–347.
[9] J. Sima and J. Bruck, “On optimal k-deletion correcting codes,” IEEE Transactions on Information Theory, vol. 67, no. 6, pp. 3360–3375, 2020.
[10] V. Guruswami and J. Håstad, “Explicit two-deletion codes with redundancy matching the existential bound,” IEEE Transactions on Information Theory, vol. 67, no. 10, pp. 6384–6394, 2021.
[11] V. Guruswami, X. He, and R. Li, “The zero-rate threshold for adversarial bit-deletions is less than ,” IEEE Transactions on Information Theory, vol. 69, no. 4, pp. 2218–2239, 2022.
[12] I. Smagloy, L. Welter, A. Wachter-Zeh, and E. Yaakobi, “Single-deletion single-substitution correcting codes,” IEEE Transactions on Information Theory, vol. 69, no. 12, pp. 7659–7671, 2023.
[13] K. Yasunaga, “Improved bounds for codes correcting insertions and deletions,” Designs, Codes and Cryptography, vol. 92, no. 5, pp. 1267–1278, 2024.
[14] P. Beelen, R. Con, A. Cruica, M. Montanucci, and E. Yaakobi, “Reed-Solomon codes against insertions and deletions: Full-length and rate-1/2 codes,” IEEE Transactions on Information Theory, vol. 72, no. 2, pp. 1149–1160, 2026.
[15] Y. Sun and G. Ge, “Codes for correcting a burst of edits using weighted-summation VT sketch,” IEEE Transactions on Information Theory, 2025.
[16] J. Bornholt, R. Lopez, D. M. Carmean, L. Ceze, G. Seelig, and K. Strauss, “A DNA-based archival storage system,” in Proceedings of the twenty-first international conference on architectural support for programming languages and operating systems, 2016, pp. 637–649.
[17] S. H. T. Yazdi, R. Gabrys, and O. Milenkovic, “Portable and error-free DNA-based data storage,” Scientific Reports, vol. 7, no. 1, p. 5011, 2017.
[18] S. Jain, F. F. Hassanzadeh, M. Schwartz, and J. Bruck, “Duplication-correcting codes for data storage in the DNA of living organisms,” IEEE Transactions on Information Theory, vol. 63, no. 8, pp. 4996–5010, 2017.
[19] D. Bar-Lev, I. Orr, O. Sabary, T. Etzion, and E. Yaakobi, “Scalable and robust DNA-based storage via coding theory and deep learning,” Nature Machine Intelligence, pp. 1–11, 2025.
[20] Y. M. Chee, H. M. Kiah, A. Vardy, E. Yaakobi, and V. K. Vu, “Codes correcting position errors in racetrack memories,” in 2017 IEEE Information Theory Workshop (ITW). IEEE, 2017, pp. 161–165.
[21] K. A. Abdel-Ghaffar, H. C. Ferreira, and L. Cheng, “On linear and cyclic codes for correcting deletions,” in 2007 IEEE International Symposium on Information Theory. IEEE, 2007, pp. 851–855.
[22] K. Cheng, V. Guruswami, B. Haeupler, and X. Li, “Efficient linear and affine codes for correcting insertions/deletions,” SIAM Journal on Discrete Mathematics, vol. 37, no. 2, pp. 748–778, 2023.
[23] Q. Ji, D. Zheng, H. Chen, and X. Wang, “Strict Half-Singleton bound, strict direct upper bound for linear insertion-deletion codes and optimal codes,” IEEE Transactions on Information Theory, vol. 69, no. 5, pp. 2900–2910, 2023.
[24] K. Cheng, Z. Jin, X. Li, Z. Wei, and Y. Zheng, “Linear insertion deletion codes in the high-noise and high-rate regimes,” in 50th International Colloquium on Automata, Languages, and Programming (ICALP 2023), ser. Leibniz International Proceedings in Informatics, vol. 261, 2023, pp. 41:1-41:17.
[25] R. Con, A. Shpilka, and I. Tamo, “Reed-Solomon codes against adversarial insertions and deletions,” IEEE Transactions on Information Theory, vol. 69, no. 5, pp. 2991–3000, 2023.
[26] R. Con, Z. Guo, R. Li, and Z. Zhang, “Random Reed-Solomon codes achieve the Half-Singleton bound for insertions and deletions over linear-sized alphabets,” in 52nd International Colloquium on Automata, Languages, and Programming (ICALP 2025), ser. Leibniz International Proceedings in Informatics, vol. 334, 2025, pp. 60:1–60:21, full version available as arXiv:2407.07299.
[27] R. Gross, R. Con, and E. Yaakobi, “Improved constructions of linear codes for insertions and deletions,” in 2025 IEEE International Symposium on Information Theory (ISIT). IEEE, 2025, pp. 1–6.
[28] J. Brakensiek, M. Dhar, and S. Gopi, “Generalized GM-MDS: Polynomial codes are higher order MDS,” IEEE Transactions on Information Theory, vol. 71, no. 12, pp. 9375–9394, Dec. 2025.
[29] J. Brakensiek, M. Dhar, S. Gopi, and Z. Zhang, “AG codes achieve list-decoding capacity over constant-sized fields,” IEEE Transactions on Information Theory, vol. 71, no. 8, pp. 5935–5956, 2025.
[30] T. Do Duc, S. Liu, I. Tjuawinata, and C. Xing, “Explicit constructions of two-dimensional Reed-Solomon codes in high insertion and deletion noise regime,” IEEE Transactions on Information Theory, vol. 67, no. 5, pp. 2808–2820, 2021.
[31] A. Weil, Foundations of algebraic geometry. American Mathematical Soc., 1946, vol. 29.
[32] J. Brakensiek, S. Gopi, and V. Makam, “Generic Reed-Solomon codes achieve list-decoding capacity,” in Proceedings of the 55th Annual ACM Symposium on Theory of Computing, 2023, pp. 1488–1501.
[33] R. Hartshorne, Algebraic geometry. Springer Science & Business Media, 2013, vol. 52.
[34] A. Garcia and H. Stichtenoth, “On the asymptotic behaviour of some towers of function fields over finite fields,” Journal of Number Theory, vol. 61, no. 2, pp. 248–273, 1996.
[35] S. Vladut, D. Nogin, and M. Tsfasman, Algebraic Geometric Codes: Basic Notions. USA: American Mathematical Society, 2007.