Introduction
Synchronization errors, such as insertions and deletions of symbols, destroy the alignment between transmitted and received strings and are much harder to correct than standard substitutions. They arise in document and file synchronization [9 ] , in DNA-based data storage [5 ] , where insertions, deletions, substitutions, and adjacent transpositions all occur, and in racetrack memories [34 , 7 ] . Codes for such errors were introduced in 1966 by Levenshtein [25 ] and Ullman [51 ] independently. Although this line of research dates back more than sixty years, it has only gained significant momentum over the past decade [32 , 23 , 3 , 15 ] . While much work in theoretical computer science addresses a constant fraction of errors [48 , 22 , 17 , 16 ] , this paper studies the classical regime of a fixed constant number t t t of errors as the block length n → ∞ n \to\infty n → ∞ , where the central problem is to minimize the required redundancy [3 , 36 , 15 ] .
We consider binary codes C ⊆ { 0 , 1 } n C \subseteq\{0,1\}^{n} C ⊆ { 0 , 1 } n correcting up to t t t errors in three standard models: t t t deletions, which is equivalent to correcting any combination of t t t insertions and deletions [25 ] ; t t t edits, consisting of insertions, deletions, and substitutions; and t t t Damerau–Levenshtein (DL) errors, which add adjacent transpositions u i u i + 1 ↦ u i + 1 u i u_i u_{i+1} \mapsto u_{i+1}u_i u i u i + 1 ↦ u i + 1 u i to the edit operations [11 ] . A code corrects t t t errors if and only if the error balls of radius t t t around distinct codewords are disjoint. Two inputs are confusable if their radius-t t t balls intersect. In each of the three models, every input in { 0 , 1 } n \{0,1\}^{n} { 0 , 1 } n is confusable with at most L = O t ( n 2 t ) L = O_t(n^{2t}) L = O t ( n 2 t ) other inputs (its competitors ). Consequently, a greedy Gilbert–Varshamov (GV) type argument guarantees the existence of codes with redundancy n − log ∣ C ∣ ≤ log ( L + 1 ) = 2 t log n + O t ( 1 ) n-\log|C| \le\log(L+1) = 2t\log n + O_t(1) n − log ∣ C ∣ ≤ log ( L + 1 ) = 2 t log n + O t ( 1 ) , while a sphere-packing argument gives the lower bound t log n − O t ( 1 ) t\log n-O_t(1) t log n − O t ( 1 ) [25 , 27 ] . Recently, Alon, Bourla, Graham, He, and Kravitz [1 ] improved the existential upper bound for deletions by a log log n \log\log n log log n term. The leading term of this existential upper bound stood for six decades. While we prepare this manuscript, En Gad [13 ] showed that for t ≥ 2 t \ge2 t ≥ 2 , ( 2 t − 1 ) log n + O t ( log log n ) (2t-1)\log n + O_t(\log\log n) ( 2 t − 1 ) log n + O t ( log log n ) redundancy suffices to correct t t t deletions and also t t t bounded substring-edits.
The GV-type argument is non-constructive, and matching its leading term 2 t log n 2t\log n 2 t log n with explicit codes that have deterministic polynomial-time encoding and decoding has been a long-standing challenge. For t = 1 t=1 t = 1 , the Varshamov–Tenengolts (VT) code and Levenshtein’s variant [52 , 25 ] achieve log n + O ( 1 ) \log n+O(1) log n + O ( 1 ) redundancy for one deletion or one edit, and Gabrys, Gruswami, Ribeiro, and Wu [GRRW23] showed that codes correcting one deletion or one adjacent transposition with log n + O ( log log n ) \log n+O(\log\log n) log n + O ( log log n ) redundancy exist. For t = 2 t=2 t = 2 deletions, Guruswami and Håstad [15 ] achieved 4 log n + O ( log log n ) 4\log n+O(\log\log n) 4 log n + O ( log log n ) redundancy, matching the leading term of the GV-type bound. For t ≥ 3 t \ge3 t ≥ 3 deletions, and for t ≥ 2 t \ge2 t ≥ 2 edits or DL errors, no explicit construction matching the 2 t log n 2t\log n 2 t log n bound was previously known, and existing general methods paid roughly twice the GV-type bound.
Our results
In this paper, we overcome this barrier for every fixed t ≥ 2 t \ge2 t ≥ 2 . We construct explicit binary codes with deterministic polynomial-time encoding and decoding that match the leading term 2 t log n 2t\log n 2 t log n of the GV-type bound for any combination of insertions, deletions, substitutions, and adjacent transpositions.
Theorem 1.1 (Main theorem). For every fixed t ≥ 2 t \ge2 t ≥ 2 and all sufficiently large n n n , there are explicit binary codes C ⊆ { 0 , 1 } n C \subseteq\{0,1\}^{n} C ⊆ { 0 , 1 } n correcting any combination of at most t t t insertions, deletions, substitutions, and adjacent transpositions, with deterministic encoders and decoders, in two variants:
(b) (greedy) after a deterministic precomputation of n 6 t + 2 + o ( 1 ) n^{6t+2+o(1)} n 6 t + 2 + o ( 1 ) time, the code has redundancy n − log ∣ C ∣ ≤ 2 t log n + 2 t log log n + O t ( 1 ) n - \log|\mathcal{C}| \le2t\log n + 2t\log\log n + O_t(1) n − log ∣ C ∣ ≤ 2 t log n + 2 t log log n + O t ( 1 ) .
In both variants, encoding and full-message decoding take O t ( n 2 t + 2 log 2 n ) O_t(n^{2t+2}\log^2 n) O t ( n 2 t + 2 log 2 n ) bit operations, and the payload, consisting of the first n − O t ( log n ) n - O_t(\log n) n − O t ( log n ) bits of the codeword, is recovered from any channel output in O t ( n t + 1 log n ) O_t(n^{t+1}\log n) O t ( n t + 1 log n ) bit operations.
Table 1 summarizes how Theorem 1.1 (a) compares with the best previous explicit constructions; a fuller historical overview is deferred to Appendix § 6 . For t t t deletions, after early explicit codes with O ( t 2 log t log n ) O(t^2\log t\log n) O ( t 2 log t log n ) and O ( t log n ) O(t\log n) O ( t log n ) redundancy [3 , 6 , 21 ] and two-deletion codes with 8 log n 8\log n 8 log n and 7 log n 7\log n 7 log n redundancy [18 , 45 ] , Guruswami and Håstad [15 ] achieved 4 log n + O ( log log n ) 4\log n + O(\log\log n) 4 log n + O ( log log n ) for t = 2 t = 2 t = 2 . This is the first known explicit binary code that its redundancy match the leading term of the GV-type upper bound. For t ≥ 3 t \ge3 t ≥ 3 deletions, Sima and Bruck [36 ] obtained 8 t log n + o ( log n ) 8t\log n + o(\log n) 8 t log n + o ( log n ) , syndrome compression [41 , 40 ] gave 4 t log n + o ( log n ) 4t\log n + o(\log n) 4 t log n + o ( log n ) , and Song, Polyanskii, Cai, and He [43 , 44 ] reduced this to ( 4 t − 1 ) log n + o ( log n ) (4t - 1)\log n + o(\log n) ( 4 t − 1 ) log n + o ( log n ) by precoding with a single-deletion syndrome. For two edits, Sun and Ge [38 ] and Pi and Zhang [35 ] constructed explicit codes with redundancy 6 log n + O ( log log n ) 6\log n + O(\log\log n) 6 log n + O ( log log n ) and 6 log n + 8 6\log n + 8 6 log n + 8 , respectively.
Table 1 : Selected redundancy upper bounds for explicit binary codes, for fixed t t t and n → ∞ n \to\infty n → ∞ . The last column uses variant (a) of Theorem 1.1 ; every row follows from the same DL construction. Full comparisons are given in Table 3 –Table 5 in Appendix § 6 .
Table 1.
Table 3. Binary codes correcting t t t deletions, or equivalently t t t insertions, or any combination of t t t insertions and deletions [25 ] , for fixed t t t and n → ∞ n\to\infty n → ∞ .
For general t t t edits, Li, Gabrys, and Farnoud [28 ] obtained 4 t log n + O ( log log n ) 4t\log n + O(\log\log n) 4 t log n + O ( log log n ) redundancy via Linial’s coloring, and combining the framework of [28 ] with Levenshtein’s single-edit syndrome yields ( 4 t − 1 ) log n + O t ( log log n ) (4t - 1)\log n + O_t(\log\log n) ( 4 t − 1 ) log n + O t ( log log n ) (see Appendix § 6 .§ 1 ). Con and Li [8 ] recently studied oblivious deletion codes, where the deletion pattern is independent of the encoder’s private randomness, and also gave a randomized construction that, with high probability over the random choice of the code, corrects t t t adversarial deletions with redundancy ( 2 t + 1 ) log n + O t ( log log n ) (2t + 1)\log n + O_t(\log\log n) ( 2 t + 1 ) log n + O t ( log log n ) . In contrast, our construction is fully deterministic, including its precomputation, and achieves 2 t log n + O t ( log log n ) 2t\log n + O_t(\log\log n) 2 t log n + O t ( log log n ) redundancy for any combination of t t t edits and adjacent transpositions.
For t t t DL errors, to the best of our knowledge, no dedicated explicit code was known for general t ≥ 2 t \ge2 t ≥ 2 , with prior works limited to special combinations such as one deletion and ℓ \ell ℓ adjacent transpositions [20 , 55 ] . Since an adjacent transposition can be simulated by two substitutions, any code correcting 2 t 2t 2 t edits corrects t t t DL errors, but this naive relaxation gives 8 t log n + O t ( log log n ) 8t\log n + O_t(\log\log n) 8 t log n + O t ( log log n ) bits of redundancy. We observe that combining the 2-substring edit syndrome of [28 Theorem 6] with our DL boundary projection lemma (Lemma 4.1 ) would yield an explicit code with 4 t log n + O t ( log log n ) 4t\log n + O_t(\log\log n) 4 t log n + O t ( log log n ) redundancy (see Appendix § 6 .§ 1 ), which our main construction further improves to $2t\log n + 2t\log\log n + O_t(\log\log\log n)`.
Related synchronization channels such as q q q -ary deletions [49 , 30 , 39 , 37 , 31 , 33 , 46 ] , permutation codes [26 , 24 , 12 , 19 , 54 , 53 ] , and ℓ \ell ℓ -symbol read channels [4 , 10 , 56 , 57 ] are not treated here.
Technique Overview
Our construction has three components:
Seed recycling and breaking the factor of two (§ 2 ). To understand the source of our improvement, we first identify why previous general methods lose a factor of two in redundancy. Consider the basic task of separating each input message x ∈ { 0 , 1 } m x \in\{0,1\}^{m} x ∈ { 0 , 1 } m from a set Γ ( x ) \Gamma(x) Γ ( x ) of at most L L L confusable competitors. In both syndrome compression [41 ] and distributed graph coloring [28 ] , the standard approach selects a hash function h a h_a h a from a hash family that avoids collisions with all competitors in Γ ( x ) \Gamma(x) Γ ( x ) , and appends the tag ( a , h a ( x ) ) (a,h_a(x)) ( a , h a ( x )) . Because the tag must describe both the seed a a a (an integer modulus p p p in syndrome compression) and the hash value h a ( x ) h_a(x) h a ( x ) (the residue modulo p p p ), and each component costs about log L \log L log L bits, the resulting tag requires about 2 log L 2\log L 2 log L bits of redundancy.
Our main tool, seed recycling , eliminates this factor-of-two penalty by making the hash seed itself nearly free. If we draw the seed a a a from a sufficiently large finite field F 2 b \mathbb{F}_{2^{b}} F 2 b , more than half of all 2 b 2^{b} 2 b seeds separate x x x from all L L L of its competitors. Instead of picking an arbitrary good seed, the encoder uses b − 1 b-1 b − 1 additional message bits as an index to select which of the first 2 b − 1 2^{b-1} 2 b − 1 good seeds to use in a canonical order; once the decoder recovers x x x , it reconstructs the same ordered list of good seeds and reads those b − 1 b-1 b − 1 message bits back from the seed’s rank. Thus, a b b b -bit seed carries b − 1 b-1 b − 1 message bits and contributes only 1 1 1 bit to the net redundancy. See Table 2 for the detailed comparison.
Table 2. Net cost of a tag separating an input from at most L L L competitors before protecting the tag (for inputs of length n n n with L = n O ( 1 ) L=n^{O(1)} L = n O ( 1 ) ).
In the first stage, we view x x x as a polynomial P x P_x P x of degree at most k − 1 k-1 k − 1 over F 2 b \mathbb{F}_{2^{b}} F 2 b , where k = ⌈ m / b ⌉ k=\lceil m/b\rceil k = ⌈ m / b ⌉ . Since each competitor can collide with x x x on at most k − 1 k-1 k − 1 roots, choosing 2 b ≥ 2 L k 2^{b}\ge2Lk 2 b ≥ 2 L k ensures that more than half of the seeds are good. However, the remaining b b b -bit hash value P x ( a ) P_x(a) P x ( a ) still depends on the number of blocks k k k . A second hashing step removes this dependence: for a good seed a a a , every difference P x ( a ) − P x ′ ( a ) P_x(a)-P_{x'}(a) P x ( a ) − P x ′ ( a ) is nonzero, so multiplying P x ( a ) P_x(a) P x ( a ) by a second seed λ ∈ F 2 b \lambda\in\mathbb{F}_{2^{b}} λ ∈ F 2 b and projecting onto the first r = ⌈ log ( 2 L ) ⌉ r=\lceil\log(2L)\rceil r = ⌈ log ( 2 L )⌉ bits fails for exactly a 2 − r 2^{-r} 2 − r fraction of multipliers λ \lambda λ for each fixed competitor x ′ x' x ′ , independent of k k k . Recycling λ \lambda λ in the same way yields a tag Tag ( x , σ , τ ) \operatorname{Tag}(x,\sigma,\tau) Tag ( x , σ , τ ) of net cost r + 2 < log L + 4 r+2<\log L+4 r + 2 < log L + 4 bits (Theorem 2.1 ; see Figure 1 ).
Figure 1. Overview of two-stage seed recycling and codeword construction (§ 2 and § 3 ). Blue blocks carry message bits, while the orange block is pure hash redundancy. Both good-seed sets and the compressed hash value depend on the payload x x x and its competitor set Γ ( x ) \Gamma(x) Γ ( x ) : each b b b -bit seed (a a a and λ \lambda λ ) is selected from at least 2 b − 1 2^{b-1} 2 b − 1 valid seeds using a ( b − 1 ) (b-1) ( b − 1 ) -bit message block (σ \sigma σ and τ \tau τ ), contributing only 1 bit to the net redundancy.
Protecting the tag on splittable channels (§ 3 ). To protect the tag against channel errors, we encode it with a short tag code A : { 0 , 1 } h → { 0 , 1 } N A:\{0,1\}^{h}\to\{0,1\}^{N} A : { 0 , 1 } h → { 0 , 1 } N and append it to the payload x ∈ { 0 , 1 } m x\in\{0,1\}^{m} x ∈ { 0 , 1 } m to form the codeword x ∥ A ( Tag ( x , σ , τ ) ) x\mathbin\Vert A(\operatorname{Tag}(x,\sigma,\tau)) x ∥ A ( Tag ( x , σ , τ )) . Although synchronization errors shift the boundary between x x x and the suffix in the received word, we show (Lemma 3.2 and Theorem 3.3 ) that this construction succeeds whenever the channel is splittable , meaning that confusable words x ∥ s x\mathbin\Vert s x ∥ s and x ′ ∥ s ′ x'\mathbin\Vert s' x ′ ∥ s ′ must have suffixes s s s and s ′ s' s ′ related by a symmetric relation R N \mathcal{R}_{N} R N that A A A separates, and whenever suffix neighborhoods, payload competitors, and channel preimages can be listed
in polynomial time. Splittability forces confusable codewords to share the exact same tag T T T and suffix s = A ( T ) s=A(T) s = A ( T ) , so x x x only needs to be separated from competitors x ′ x' x ′ that confuse with x x x when followed by a common suffix s s s . In our DL application, the tag has length h = O t ( log n ) h=O_t(\log n) h = O t ( log n ) , and protecting it adds only 2 t log log n + O t ( 1 ) 2t\log\log n+O_t(1) 2 t log log n + O t ( 1 ) bits of overhead with a greedy tag code, or 2 t log log n + O t ( log log log n ) 2t\log\log n+O_t(\log\log\log n) 2 t log log n + O t ( log log log n ) bits when we bootstrap our own code family at length O t ( log n ) O_t(\log n) O t ( log n ) to reduce the precomputation time to polylog ( n ) \operatorname{polylog}(n) polylog ( n ) .
Boundary tracking for DL errors (§ 4 ). For the Damerau–Levenshtein metric, an adjacent transposition across the boundary between x x x and s s s modifies both parts in a single operation. By tracking a boundary marker through a shortest sequence of operations and bounding the suffix distortion together with the displacement of the marker, we prove the suffix projection bound d D L ( s , s ′ ) ≤ d D L ( x ∥ s , x ′ ∥ s ′ ) d_{\mathrm{DL}}(s,s')\le d_{\mathrm{DL}}(x\mathbin\Vert s,x'\mathbin\Vert s') d DL ( s , s ′ ) ≤ d DL ( x ∥ s , x ′ ∥ s ′ ) for all x , x ′ ∈ { 0 , 1 } m x,x'\in\{0,1\}^{m} x , x ′ ∈ { 0 , 1 } m and s , s ′ ∈ { 0 , 1 } N s,s'\in\{0,1\}^{N} s , s ′ ∈ { 0 , 1 } N (Lemma 4.1 ). Since string reversal preserves d D L d_{\mathrm{DL}} d DL and exchanges prefixes with suffixes, the same bound holds for the prefixes: d D L ( x , x ′ ) ≤ d D L ( x ∥ s , x ′ ∥ s ′ ) d_{\mathrm{DL}}(x,x')\le d_{\mathrm{DL}}(x\mathbin\Vert s,x'\mathbin\Vert s') d DL ( x , x ′ ) ≤ d DL ( x ∥ s , x ′ ∥ s ′ ) . In particular, d D L ( x ∥ s , x ′ ∥ s ′ ) = d D L ( x , x ′ ) d_{\mathrm{DL}}(x\mathbin\Vert s,x'\mathbin\Vert s')=d_{\mathrm{DL}}(x,x') d DL ( x ∥ s , x ′ ∥ s ′ ) = d DL ( x , x ′ ) , which identifies the exact payload competitor set of x x x as the same-length DL ball ( B 2 t ( x ) ∩ { 0 , 1 } m ) ∖ { x } (B_{2t}(x)\cap\{0,1\}^{m})\setminus\{x\} ( B 2 t ( x ) ∩ { 0 , 1 } m ) ∖ { x } of size at most ( 2 t + 1 ) 10 2 t n 2 t (2t+1)10^{2t}n^{2t} ( 2 t + 1 ) 1 0 2 t n 2 t (Corollary 4.2 ).
Outline and notation
In § 2 , we present our seed recycling construction (Theorem 2.1 ). In § 3 , we introduce splittable channels and prove our general code construction theorem (Theorem 3.3 ). In § 4 , we establish the boundary projection property and prove our main result for Damerau–Levenshtein errors (Theorem 4.3 , which proves Theorem 1.1 ), followed by open problems in § 5 . Appendix § 6 provides the full historical comparison tables and a summary of notation, Appendix § 7 gives the formal specification of the generic decoder, Appendix § 8 gives the deterministic finite-field and enumeration algorithms, and Appendix § 9 proves the bootstrapping lemma.
Throughout the paper, all algorithms are base 2. For integers a ≤ b a\le b a ≤ b , we write [ a , b ] = { a , … , b } [a,b]=\{a,\ldots,b\} [ a , b ] = { a , … , b } and [ K ] = [ 1 , K ] [K]=[1,K] [ K ] = [ 1 , K ] . For a string u = u 1 ⋯ u ℓ ∈ { 0 , 1 } ℓ u=u_1\cdots u_\ell\in\{0,1\}^{\ell} u = u 1 ⋯ u ℓ ∈ { 0 , 1 } ℓ , we write ∣ u ∣ = ℓ |u|=\ell ∣ u ∣ = ℓ , u [ i , j ] = u i ⋯ u j u_{[i,j]}=u_i\cdots u_j u [ i , j ] = u i ⋯ u j , val ( u ) = ∑ i = 1 ℓ u i 2 ℓ − i ∈ [ 0 , 2 ℓ − 1 ] \operatorname{val}(u)=\sum_{i=1}^{\ell}u_i2^{\ell-i}\in[0,2^\ell-1] val ( u ) = ∑ i = 1 ℓ u i 2 ℓ − i ∈ [ 0 , 2 ℓ − 1 ] , and bin ℓ : [ 0 , 2 ℓ − 1 ] → { 0 , 1 } ℓ \operatorname{bin}_{\ell}:[0,2^\ell-1]\to\{0,1\}^{\ell} bin ℓ : [ 0 , 2 ℓ − 1 ] → { 0 , 1 } ℓ for the inverse of val \operatorname{val} val . Concatenation is written as u v uv uv or u ∥ v u\|v u ∥ v , and ker \ker ker denotes the kernel of an F 2 \mathbb{F}_2 F 2 -linear map. The number of errors t ≥ 1 t\ge1 t ≥ 1 is a fixed constant, and O t ( ⋅ ) O_t(\cdot) O t ( ⋅ ) hides factors depending only on t t t .
Seed recycling
In our basic setup, we have an unknown string x ∈ { 0 , 1 } m x\in\{0,1\}^m x ∈ { 0 , 1 } m which is corrupted by a channel to obtain a received string y y y . The goal is to reconstruct x x x from y y y . In general, y y y alone is not sufficient to identify x x x uniquely, and we wish to provide a short “tag” (or sketch) of x x x that enables the decoder to recover x x x . Since the encoder does not know which output y y y will be received, the tag must distinguish x x x from every other string x ′ x' x ′ that can produce a common output with x x x . We refer to such strings as the competitors of x x x . Let
Γ ( x ) ⊆ { 0 , 1 } m ∖ { x } with ∣ Γ ( x ) ∣ ≤ L \Gamma(x)\subseteq\{0,1\}^m\setminus\{x\}\qquad\text{with}\qquad|\Gamma(x)|\le L Γ ( x ) ⊆ { 0 , 1 } m ∖ { x } with ∣Γ ( x ) ∣ ≤ L
be a set containing all competitors of x x x , where m , L ≥ 1 m,L\ge1 m , L ≥ 1 are integers. For now, we assume that the tag is known to the decoder without errors; in § 3 , we will see how to encode and append the tag to x x x itself. The construction in this section uses only x x x and Γ ( x ) \Gamma(x) Γ ( x ) .
A standard way to construct a separating tag is to choose a hash function that separates x x x from every string in Γ ( x ) \Gamma(x) Γ ( x ) , and specify both the seed of the hash function and the hash value (as in the syndrome compression method of [41 ] ). This requires paying for both the seed and the hash output. Here we use a simple observation that if the pool of seeds is large enough, then many seeds are valid for the same x x x , and it does not matter which valid seed we use. We can therefore order all valid seeds for x x x and use c c c additional message bits as an index to select which valid seed to include in the tag. Once the decoder has reconstructed x x x , it can compute the same ordered list of valid seeds, find the position of the chosen seed in this list, and read off the c c c additional message bits. Thus, if the tag has length h h h in total, its net cost in redundancy is only h − c h-c h − c bits.
We carry out this idea in two steps: we first apply seed recycling to polynomial hashing over F 2 b \mathbb{F}_{2^b} F 2 b , and then add a second, linear hashing step to compress the hash value itself.
Hashing and seed selection
Let Q = 2 b Q=2^b Q = 2 b , and fix an F 2 \mathbb{F}_2 F 2 -linear bijection φ : { 0 , 1 } b → F Q \varphi:\{0,1\}^b\to\mathbb{F}_Q φ : { 0 , 1 } b → F Q , which orders F Q \mathbb{F}_Q F Q by the integer value
ι ( a ) = val ( φ − 1 ( a ) ) . \iota(a)=\operatorname{val}(\varphi^{-1}(a)). ι ( a ) = val ( φ − 1 ( a )) .
We pad x ∈ { 0 , 1 } m x\in\{0,1\}^m x ∈ { 0 , 1 } m with zeroes to length k b kb k b , where k = ⌈ m / b ⌉ k=\lceil m/b\rceil k = ⌈ m / b ⌉ , and divide it into k k k blocks of b b b bits. Viewing these blocks as field elements X 0 , … , X k − 1 ∈ F Q X_0,\ldots,X_{k-1}\in\mathbb{F}_Q X 0 , … , X k − 1 ∈ F Q , we define
P x ( Z ) = ∑ i = 0 k − 1 X i Z i . P_x(Z)=\sum_{i=0}^{k-1}X_iZ^i. P x ( Z ) = i = 0 ∑ k − 1 X i Z i .
For any x ′ ≠ x x'\ne x x ′ = x , the difference P x − P x ′ P_x-P_{x'} P x − P x ′ is a nonzero polynomial of degree at most k − 1 k-1 k − 1 , and thus has at most k − 1 k-1 k − 1 roots in F Q \mathbb{F}_Q F Q .
We call a seed a ∈ F Q a\in\mathbb{F}_Q a ∈ F Q good for x x x if it avoids collisions with all competitors of x x x , and set
Good 1 ( x ) = { a ∈ F Q : P x ( a ) ≠ P x ′ ( a ) for every x ′ ∈ Γ ( x ) } . \operatorname{Good}_1(x)=\{a\in\mathbb{F}_Q:P_x(a)\ne P_{x'}(a)\text{ for every }x'\in\Gamma(x)\}. Good 1 ( x ) = { a ∈ F Q : P x ( a ) = P x ′ ( a ) for every x ′ ∈ Γ ( x )} .
Since each of the at most L L L competitors rules out at most k − 1 k-1 k − 1 seeds, choosing b b b such that 2 b ≥ 2 L ⌈ m / b ⌉ 2^b\ge2L\lceil m/b\rceil 2 b ≥ 2 L ⌈ m / b ⌉ ensures that more than half of all seeds in F Q \mathbb{F}_Q F Q are good:
∣ Good 1 ( x ) ∣ ≥ Q − L ( k − 1 ) > Q / 2. (1) |\operatorname{Good}_1(x)|\ge Q-L(k-1)>Q/2. \tag*{(1)} ∣ Good 1 ( x ) ∣ ≥ Q − L ( k − 1 ) > Q /2. (1)
Because ∣ Good 1 ( x ) ∣ > Q / 2 = 2 b − 1 |\operatorname{Good}_1(x)|>Q/2=2^{b-1} ∣ Good 1 ( x ) ∣ > Q /2 = 2 b − 1 , the encoder can use b − 1 b-1 b − 1 additional message bits to select one of the first 2 b − 1 2^{b-1} 2 b − 1 seeds in Good 1 ( x ) \operatorname{Good}_1(x) Good 1 ( x ) , and the decoder can recover these bits from the rank of a a a in Good 1 ( x ) \operatorname{Good}_1(x) Good 1 ( x ) once x x x is known. Thus, the 2 b 2b 2 b -bit tag ( a , P x ( a ) ) (a,P_x(a)) ( a , P x ( a )) has net cost 2 b − ( b − 1 ) = b + 1 2b-(b-1)=b+1 2 b − ( b − 1 ) = b + 1 . However, since 2 b ≥ 2 L ⌈ m / b ⌉ 2^b\ge2L\lceil m/b\rceil 2 b ≥ 2 L ⌈ m / b ⌉ requires b ≥ log ( 2 L k ) b\ge\log(2Lk) b ≥ log ( 2 L k ) , the b b b -bit hash value P x ( a ) P_x(a) P x ( a ) makes this net cost grow with the number of blocks k k k . We next shorten this hash value to remove the dependence on k k k .
Compressing the hash value
Suppose we have fixed a good seed a ∈ Good 1 ( x ) a \in\operatorname{Good}_1(x) a ∈ Good 1 ( x ) . By definition, for every competitor x ′ ∈ Γ ( x ) x' \in\Gamma(x) x ′ ∈ Γ ( x ) , the difference δ x ′ = P x ( a ) − P x ′ ( a ) \delta_{x'} = P_x(a) - P_{x'}(a) δ x ′ = P x ( a ) − P x ′ ( a ) is a nonzero element of F Q \mathbb{F}_Q F Q . Let 1 ≤ r ≤ b 1 \le r \le b 1 ≤ r ≤ b , and let π : F Q → { 0 , 1 } r \pi: \mathbb{F}_Q \to\{0,1\}^r π : F Q → { 0 , 1 } r be the F 2 \mathbb{F}_2 F 2 -linear projection that outputs the first r r r bits of the binary representation of a field element, with kernel ker π = { z ∈ F Q : π ( z ) = 0 r } \ker\pi= \{z \in\mathbb{F}_Q : \pi(z) = 0^r\} ker π = { z ∈ F Q : π ( z ) = 0 r } of size 2 b − r 2^{b-r} 2 b − r . We consider the second-stage hash function z ↦ π ( λ z ) z \mapsto\pi(\lambda z) z ↦ π ( λ z ) for λ ∈ F Q \lambda\in\mathbb{F}_Q λ ∈ F Q . For any nonzero δ ∈ F Q \delta\in\mathbb{F}_Q δ ∈ F Q , the map λ ↦ λ δ \lambda\mapsto\lambda\delta λ ↦ λ δ is a bijection on F Q \mathbb{F}_Q F Q , so there are exactly ∣ ker π ∣ = 2 b − r |\ker\pi| = 2^{b-r} ∣ ker π ∣ = 2 b − r values of λ ∈ F Q \lambda\in\mathbb{F}_Q λ ∈ F Q for which π ( λ δ ) = 0 r \pi(\lambda\delta) = 0^r π ( λ δ ) = 0 r . In other words, each competitor x ′ ∈ Γ ( x ) x' \in\Gamma(x) x ′ ∈ Γ ( x ) rules out a 2 − r 2^{-r} 2 − r fraction of the multipliers λ \lambda λ , and this fraction is independent of the degree of P x P_x P x .
Analogously to the first stage, we define the set of good multipliers for ( x , a ) (x,a) ( x , a ) by
Good 2 ( x , a ) = { λ ∈ F Q : π ( λ P x ( a ) ) ≠ π ( λ P x ′ ( a ) ) for every x ′ ∈ Γ ( x ) } . \operatorname{Good}_2(x,a)=\{\lambda\in\mathbb{F}_Q : \pi(\lambda P_x(a)) \ne\pi(\lambda P_{x'}(a)) \text{ for every } x' \in\Gamma(x)\}. Good 2 ( x , a ) = { λ ∈ F Q : π ( λ P x ( a )) = π ( λ P x ′ ( a )) for every x ′ ∈ Γ ( x )} .
Taking a union bound over the at most L L L competitors in Γ ( x ) \Gamma(x) Γ ( x ) , we have
∣ Good 2 ( x , a ) ∣ ≥ Q − L 2 b − r ≥ Q / 2 , provided that 2 r ≥ 2 L . (2) |\operatorname{Good}_2(x,a)| \ge Q - L2^{b-r} \ge Q/2,\qquad\text{provided that } 2^r \ge2L. \tag*{(2)} ∣ Good 2 ( x , a ) ∣ ≥ Q − L 2 b − r ≥ Q /2 , provided that 2 r ≥ 2 L . (2)
Thus, we can use another b − 1 b-1 b − 1 message bits to select one of the first Q / 2 Q/2 Q /2 elements of Good 2 ( x , a ) \operatorname{Good}_2(x,a) Good 2 ( x , a ) . Together, the two seeds a a a and λ \lambda λ take 2 b 2b 2 b bits to specify and carry 2 b − 2 2b-2 2 b − 2 additional message bits. Their combined contribution to the net cost is only two bits, on top of the r r r bits needed for the hash value π ( λ P x ( a ) ) \pi(\lambda P_x(a)) π ( λ P x ( a )) .
The tag and its recovery
We now state the complete construction. Fix integers b , r b,r b , r satisfying
2 b ≥ 2 L ⌈ m / b ⌉ , 2 r ≥ 2 L , 1 ≤ r ≤ b , (3) 2^b \ge2L\lceil m/b\rceil,\qquad2^r \ge2L,\qquad1 \le r \le b, \tag*{(3)} 2 b ≥ 2 L ⌈ m / b ⌉ , 2 r ≥ 2 L , 1 ≤ r ≤ b , (3)
and let K = 2 b − 1 K=2^{b-1} K = 2 b − 1 . Given the string x ∈ { 0 , 1 } m x \in\{0,1\}^m x ∈ { 0 , 1 } m and two blocks of additional message bits σ , τ ∈ { 0 , 1 } b − 1 \sigma,\tau\in\{0,1\}^{b-1} σ , τ ∈ { 0 , 1 } b − 1 , we set v = 1 + val ( σ ) v=1+\operatorname{val}(\sigma) v = 1 + val ( σ ) , w = 1 + val ( τ ) w=1+\operatorname{val}(\tau) w = 1 + val ( τ ) . We then let a a a be the v v v -th element of Good 1 ( x ) \operatorname{Good}_1(x) Good 1 ( x ) and λ \lambda λ be the w w w -th element of Good 2 ( x , a ) \operatorname{Good}_2(x,a) Good 2 ( x , a ) under the fixed ordering of F Q \mathbb{F}_Q F Q . By eqns. (1) and (2), both sets have size at least K K K , so a a a and λ \lambda λ are well-defined. The tag is given by
Tag ( x , σ , τ ) = φ − 1 ( a ) ∥ φ − 1 ( λ ) ∥ π ( λ P x ( a ) ) . (4) \operatorname{Tag}(x,\sigma,\tau)=\varphi^{-1}(a)\mathbin\Vert\varphi^{-1}(\lambda)\mathbin\Vert\pi(\lambda P_x(a)). \tag*{(4)} Tag ( x , σ , τ ) = φ − 1 ( a ) ∥ φ − 1 ( λ ) ∥ π ( λ P x ( a )) . (4)
Example. Let m = 6 m=6 m = 6 , b = 3 b=3 b = 3 , and L = r = 2 L=r=2 L = r = 2 (so k = 2 k=2 k = 2 , K = 4 K=4 K = 4 ). Take F 8 = F 2 [ U ] / ( U 3 + U + 1 ) \mathbb{F}_8=\mathbb{F}_2[U]/(U^3+U+1) F 8 = F 2 [ U ] / ( U 3 + U + 1 ) with φ ( u 1 u 2 u 3 ) = u 1 + u 2 U + u 3 U 2 \varphi(u_1u_2u_3)=u_1+u_2U+u_3U^2 φ ( u 1 u 2 u 3 ) = u 1 + u 2 U + u 3 U 2 , which orders F 8 \mathbb{F}_8 F 8 as 0 , U 2 , U , U + U 2 , 1 , 1 + U 2 , 1 + U , 1 + U + U 2 0,U^2,U,U+U^2,1,1+U^2,1+U,1+U+U^2 0 , U 2 , U , U + U 2 , 1 , 1 + U 2 , 1 + U , 1 + U + U 2 . Suppose x = 101100 x=101100 x = 101100 , Γ ( x ) = { 000000 , 101000 } \Gamma(x)=\{000000,101000\} Γ ( x ) = { 000000 , 101000 } , and the additional message bits are σ = 10 \sigma=10 σ = 10 and τ = 01 \tau=01 τ = 01 .
Stage 1: We have P x ( Z ) = ( 1 + U 2 ) + Z P_x(Z)=(1+U^2)+Z P x ( Z ) = ( 1 + U 2 ) + Z and P x ′ ( Z ) ∈ { 0 , 1 + U 2 } P_{x'}(Z)\in\{0,1+U^2\} P x ′ ( Z ) ∈ { 0 , 1 + U 2 } . The differences P x − P x ′ P_x-P_{x'} P x − P x ′ have roots 1 + U 2 1+U^2 1 + U 2 and 0 0 0 , leaving Good 1 ( x ) = ( U 2 , U , U + U 2 , 1 , 1 + U , 1 + U + U 2 ) \operatorname{Good}_1(x)=(U^2,U,U+U^2,1,1+U,1+U+U^2) Good 1 ( x ) = ( U 2 , U , U + U 2 , 1 , 1 + U , 1 + U + U 2 ) . The bits σ = 10 \sigma=10 σ = 10 give rank v = 3 v=3 v = 3 , which selects a = U + U 2 a=U+U^2 a = U + U 2 and P x ( a ) = 1 + U P_x(a)=1+U P x ( a ) = 1 + U .
Stage 2: At a = U + U 2 a=U+U^2 a = U + U 2 , the differences δ = P x ( a ) − P x ′ ( a ) \delta=P_x(a)-P_{x'}(a) δ = P x ( a ) − P x ′ ( a ) are 1 + U 1+U 1 + U and U + U 2 U+U^2 U + U 2 . Since ker π = { 0 , U 2 } \ker\pi=\{0,U^2\} ker π = { 0 , U 2 } , the bad multipliers are ⋃ δ ∈ { 1 + U , U + U 2 } δ − 1 ker π = { 0 , 1 + U 2 , 1 + U + U 2 } \bigcup_{\delta\in\{1+U,U+U^2\}}\delta^{-1}\ker\pi=\{0,1+U^2,1+U+U^2\} ⋃ δ ∈ { 1 + U , U + U 2 } δ − 1 ker π = { 0 , 1 + U 2 , 1 + U + U 2 } , leaving Good 2 ( x , a ) = ( U 2 , U , U + U 2 , 1 , 1 + U ) \operatorname{Good}_2(x,a)=(U^2,U,U+U^2,1,1+U) Good 2 ( x , a ) = ( U 2 , U , U + U 2 , 1 , 1 + U ) . The bits τ = 01 \tau=01 τ = 01 give rank w = 2 w=2 w = 2 , selecting λ = U \lambda=U λ = U and hash value π ( λ P x ( a ) ) = π ( U + U 2 ) = 01 \pi(\lambda P_x(a))=\pi(U+U^2)=01 π ( λ P x ( a )) = π ( U + U 2 ) = 01 .
The resulting 8-bit tag is Tag ( x , 10 , 01 ) = 011 ∥ 010 ∥ 01 \operatorname{Tag}(x,10,01)=011\mathbin\Vert010\mathbin\Vert01 Tag ( x , 10 , 01 ) = 011 ∥ 010 ∥ 01 , which carries the 4 bits σ τ \sigma\tau σ τ at a net cost of 4 bits. Conversely, given x x x and the tag, the decoder recomputes Good 1 ( x ) \operatorname{Good}_1(x) Good 1 ( x ) and Good 2 ( x , a ) \operatorname{Good}_2(x,a) Good 2 ( x , a ) and reads off the ranks 3 and 2 to recover σ = 10 \sigma=10 σ = 10 and τ = 01 \tau=01 τ = 01 .
We summarize the properties of our tag construction in the following theorem.
Theorem 2.1 (Seed recycling). For every assignment Γ ( x ) ⊂ { 0 , 1 } m ∖ { x } \Gamma(x) \subset\{0,1\}^{m} \setminus\{x\} Γ ( x ) ⊂ { 0 , 1 } m ∖ { x } with ∣ Γ ( x ) ∣ ≤ L |\Gamma(x)| \le L ∣Γ ( x ) ∣ ≤ L , and any parameters b , r b,r b , r satisfying (3) , the map
Tag : { 0 , 1 } m × { 0 , 1 } b − 1 × { 0 , 1 } b − 1 ⟶ { 0 , 1 } 2 b + r \operatorname{Tag} : \{0,1\}^{m} \times\{0,1\}^{b-1} \times\{0,1\}^{b-1} \longrightarrow\{0,1\}^{2b+r} Tag : { 0 , 1 } m × { 0 , 1 } b − 1 × { 0 , 1 } b − 1 ⟶ { 0 , 1 } 2 b + r defined in (4) satisfies the following properties:
(a) If x ′ ∈ Γ ( x ) x' \in\Gamma(x) x ′ ∈ Γ ( x ) , then Tag ( x , σ , τ ) ≠ Tag ( x ′ , σ ′ , τ ′ ) \operatorname{Tag}(x,\sigma,\tau) \ne\operatorname{Tag}(x',\sigma',\tau') Tag ( x , σ , τ ) = Tag ( x ′ , σ ′ , τ ′ ) for all σ , τ , σ ′ , τ ′ ∈ { 0 , 1 } b − 1 \sigma,\tau,\sigma',\tau' \in\{0,1\}^{b-1} σ , τ , σ ′ , τ ′ ∈ { 0 , 1 } b − 1 .
(b) For each fixed x x x , the map ( σ , τ ) ↦ Tag ( x , σ , τ ) (\sigma,\tau) \mapsto\operatorname{Tag}(x,\sigma,\tau) ( σ , τ ) ↦ Tag ( x , σ , τ ) is injective, and the pair ( σ , τ ) (\sigma,\tau) ( σ , τ ) can be uniquely recovered from x x x and Tag ( x , σ , τ ) \operatorname{Tag}(x,\sigma,\tau) Tag ( x , σ , τ ) .
(c) The tag carries 2 b − 2 2b-2 2 b − 2 additional message bits and has net cost r + 2 r+2 r + 2 . In particular, setting r = ⌈ log ( 2 L ) ⌉ r=\lceil\log(2L) \rceil r = ⌈ log ( 2 L )⌉ gives net cost less than log L + 4 \log L+4 log L + 4 .
Proof. Suppose that Tag ( x , σ , τ ) = Tag ( x ′ , σ ′ , τ ′ ) \operatorname{Tag}(x,\sigma,\tau)=\operatorname{Tag}(x',\sigma',\tau') Tag ( x , σ , τ ) = Tag ( x ′ , σ ′ , τ ′ ) for some x ′ ∈ Γ ( x ) x' \in\Gamma(x) x ′ ∈ Γ ( x ) . Comparing the first two parts of the tags shows that both tags must use the same seeds a a a and λ \lambda λ . Comparing the last part then gives π ( λ P x ( a ) ) = π ( λ P x ′ ( a ) ) \pi(\lambda P_x(a))=\pi(\lambda P_{x'}(a)) π ( λ P x ( a )) = π ( λ P x ′ ( a )) , which contradicts the fact that λ ∈ Good 2 ( x , a ) \lambda\in\operatorname{Good}_2(x,a) λ ∈ Good 2 ( x , a ) . Note that this argument uses only the fact that the seeds are good for x x x , so we do not require x ∈ Γ ( x ′ ) x \in\Gamma(x') x ∈ Γ ( x ′ ) .
For a fixed x x x , distinct values of σ \sigma σ select distinct first seeds a ∈ Good 1 ( x ) a \in\operatorname{Good}_1(x) a ∈ Good 1 ( x ) . When both x x x and σ \sigma σ are fixed, distinct values of τ \tau τ select distinct multipliers λ ∈ Good 2 ( x , a ) \lambda\in\operatorname{Good}_2(x,a) λ ∈ Good 2 ( x , a ) . Thus the map ( σ , τ ) ↦ Tag ( x , σ , τ ) (\sigma,\tau) \mapsto\operatorname{Tag}(x,\sigma,\tau) ( σ , τ ) ↦ Tag ( x , σ , τ ) is injective. Once x x x and its tag are known, the decoder can reconstruct Good 1 ( x ) \operatorname{Good}_1(x) Good 1 ( x ) and Good 2 ( x , a ) \operatorname{Good}_2(x,a) Good 2 ( x , a ) and recover σ \sigma σ and τ \tau τ from the ranks of a a a and λ \lambda λ . Finally, the net cost of the tag is ( 2 b + r ) − ( 2 b − 2 ) = r + 2 (2b+r)-(2b-2)=r+2 ( 2 b + r ) − ( 2 b − 2 ) = r + 2 , which for r = ⌈ log ( 2 L ) ⌉ r=\lceil\log(2L) \rceil r = ⌈ log ( 2 L )⌉ is less than log ( 2 L ) + 3 = log L + 4 \log(2L)+3=\log L+4 log ( 2 L ) + 3 = log L + 4 . □
Order of recovery. Note that in a tag T = Tag ( x , σ , τ ) = φ − 1 ( a ) ∥ φ − 1 ( λ ) ∥ η T=\operatorname{Tag}(x,\sigma,\tau)=\varphi^{-1}(a)\mathbin\Vert\varphi^{-1}(\lambda)\mathbin\Vert\eta T = Tag ( x , σ , τ ) = φ − 1 ( a ) ∥ φ − 1 ( λ ) ∥ η , the seeds a a a and λ \lambda λ are given explicitly. Thus, to test whether a candidate string z z z matches T T T , the decoder does not need to know the ranks of a a a and λ \lambda λ : it simply checks whether π ( λ P z ( a ) ) = η \pi(\lambda P_z(a))=\eta π ( λ P z ( a )) = η . If the decoder has a list of candidate strings consisting of x x x and a subset of Γ ( x ) \Gamma(x) Γ ( x ) , then x x x clearly passes this test, whereas every z ∈ Γ ( x ) z \in\Gamma(x) z ∈ Γ ( x ) fails because λ ∈ Good 2 ( x , a ) \lambda\in\operatorname{Good}_2(x,a) λ ∈ Good 2 ( x , a ) gives π ( λ P z ( a ) ) ≠ π ( λ P x ( a ) ) = η \pi(\lambda P_z(a)) \ne\pi(\lambda P_x(a))=\eta π ( λ P z ( a )) = π ( λ P x ( a )) = η . Once x x x is uniquely identified as the passing candidate, the decoder reconstructs Good 1 ( x ) \operatorname{Good}_1(x) Good 1 ( x ) and Good 2 ( x , a ) \operatorname{Good}_2(x,a) Good 2 ( x , a ) and recovers ( σ , τ ) (\sigma,\tau) ( σ , τ ) from the ranks of a a a and λ \lambda λ .
Computing the tag. If we choose b = ⌈ log ( 2 L m ) ⌉ b=\lceil\log(2Lm) \rceil b = ⌈ log ( 2 L m )⌉ and r = ⌈ log ( 2 L ) ⌉ r=\lceil\log(2L) \rceil r = ⌈ log ( 2 L )⌉ , then (3) holds and the field size satisfies Q = 2 b < 4 L m Q=2^b<4Lm Q = 2 b < 4 L m . Consequently, given x x x and a list of the elements of Γ ( x ) \Gamma(x) Γ ( x ) , we can compute Tag ( x , σ , τ ) \operatorname{Tag}(x,\sigma,\tau) Tag ( x , σ , τ ) and recover ( σ , τ ) (\sigma,\tau) ( σ , τ ) deterministically in time polynomial in m m m , L L L , and the length of the list. Indeed, one can simply test all Q Q Q elements of F Q \mathbb{F}_Q F Q against the list of competitors to form Good 1 ( x ) \operatorname{Good}_1(x) Good 1 ( x ) and Good 2 ( x , a ) \operatorname{Good}_2(x,a) Good 2 ( x , a ) . In Appendix C (Lemma C.5 ), we give a more efficient implementation that computes the bad-seed sets Bad 1 ( x ) = F Q ∖ Good 1 ( x ) \operatorname{Bad}_1(x)=\mathbb{F}_Q\setminus\operatorname{Good}_1(x) Bad 1 ( x ) = F Q ∖ Good 1 ( x ) , Bad 2 ( x , a ) = F Q ∖ Good 2 ( x , a ) \operatorname{Bad}_2(x,a)=\mathbb{F}_Q\setminus\operatorname{Good}_2(x,a) Bad 2 ( x , a ) = F Q ∖ Good 2 ( x , a ) directly by finding roots of difference polynomials and enumerating scaled copies of ker π \ker\pi ker π , followed by selection and ranking using the sorted bad-seed lists.
Furthermore, to obtain an error-correcting code, we must also protect the tag against channel errors. The next section gives a sufficient splitting condition under which this can be achieved by encoding the tag with a short error-correcting code and appending the result to the payload.
From tags to error-correcting codes
In Section 2, we showed how to construct a short tag that distinguishes a string from its competitors while carrying additional message bits, under the assumption that the tag is known to the decoder without errors. To obtain an actual error-correcting code, we encode the tag itself by a short error-correcting code and append the encoded tag to the message. Since the tag is much shorter than the message, protecting it adds only a small number of extra redundant bits.
Protecting the tag
Let h = 2 b + r h = 2b + r h = 2 b + r be the length of the tag from § 2 , and let A : { 0 , 1 } h → { 0 , 1 } N A : \{0,1\}^{h} \to\{0,1\}^{N} A : { 0 , 1 } h → { 0 , 1 } N be an encoding that maps the h h h -bit tag to a protected suffix of length N N N . Given a payload x ∈ { 0 , 1 } m x \in\{0,1\}^{m} x ∈ { 0 , 1 } m and additional message bits σ , τ ∈ { 0 , 1 } b − 1 \sigma,\tau\in\{0,1\}^{b-1} σ , τ ∈ { 0 , 1 } b − 1 , we form a codeword of length n = m + N n = m + N n = m + N by appending the encoded tag to x x x :
Enc ( x , σ , τ ) = x ∥ A ( Tag ( x , σ , τ ) ) , n = m + N . (5) \operatorname{Enc}(x,\sigma,\tau) = x\mathbin\Vert A(\operatorname{Tag}(x,\sigma,\tau)), \qquad n = m + N. \tag*{(5)} Enc ( x , σ , τ ) = x ∥ A ( Tag ( x , σ , τ )) , n = m + N . (5)
When channel errors can change the length of a string (such as deletions or insertions), the boundary between the payload x x x and the suffix s s s is no longer known in the received word y y y . For example, if we delete the first bit of the suffix s s s in 101 ∥ 010 → 10110 101\mathbin\Vert010 \to10110 101 ∥ 010 → 10110 , the last three bits of the received word are 110 110 110 , which mixes a bit from x x x with bits from s s s . However, for any two transmitted words x ∥ s x\mathbin\Vert s x ∥ s and x ′ ∥ s ′ x'\mathbin\Vert s' x ′ ∥ s ′ of length n = m + N n = m + N n = m + N , the boundary between the m m m -bit prefix and the N N N -bit suffix is fixed before transmission. Thus, if the channel has the property that any two confusable words x ∥ s x\mathbin\Vert s x ∥ s and x ′ ∥ s ′ x'\mathbin\Vert s' x ′ ∥ s ′ must have suffixes s s s and s ′ s' s ′ that are close to each other, we can design the map A A A to keep distinct tags far apart.
Formally, a channel E = ( E n ) n ≥ 1 \mathcal{E} = (\mathcal{E}_n)_{n \ge1} E = ( E n ) n ≥ 1 assigns to each input u ∈ { 0 , 1 } n u \in\{0,1\}^{n} u ∈ { 0 , 1 } n a set E n ( u ) ⊆ { 0 , 1 } ∗ \mathcal{E}_n(u) \subseteq\{0,1\}^{*} E n ( u ) ⊆ { 0 , 1 } ∗ of possible outputs, with u ∈ E n ( u ) u \in\mathcal{E}_n(u) u ∈ E n ( u ) . We say that two inputs u , u ′ ∈ { 0 , 1 } n u,u' \in\{0,1\}^{n} u , u ′ ∈ { 0 , 1 } n are confusable , and write u ∼ n u ′ u \sim_n u' u ∼ n u ′ , if they can produce a common output:
u ∼ n u ′ ⟺ E n ( u ) ∩ E n ( u ′ ) ≠ ∅ . u \sim_n u' \iff\mathcal{E}_n(u) \cap\mathcal{E}_n(u') \ne\varnothing. u ∼ n u ′ ⟺ E n ( u ) ∩ E n ( u ′ ) = ∅ .
A code C ⊆ { 0 , 1 } n C \subseteq\{0,1\}^{n} C ⊆ { 0 , 1 } n corrects E n \mathcal{E}_n E n if no two distinct codewords in C C C are confusable.
Definition 3.1 (Splittability). Let n = m + N n = m + N n = m + N , and let R N R_N R N be a reflexive and symmetric relation on { 0 , 1 } N \{0,1\}^{N} { 0 , 1 } N . We say that E n \mathcal{E}_n E n is ( m , N , R N ) (m,N,R_N) ( m , N , R N ) -splittable if for all x , x ′ ∈ { 0 , 1 } m x,x' \in\{0,1\}^{m} x , x ′ ∈ { 0 , 1 } m and s , s ′ ∈ { 0 , 1 } N s,s' \in\{0,1\}^{N} s , s ′ ∈ { 0 , 1 } N ,
( x ∥ s ) ∼ n ( x ′ ∥ s ′ ) ⟹ ( s , s ′ ) ∈ R N . (6) (x\mathbin\Vert s) \sim_n (x'\mathbin\Vert s') \Longrightarrow(s,s') \in R_N. \tag*{(6)} ( x ∥ s ) ∼ n ( x ′ ∥ s ′ ) ⟹ ( s , s ′ ) ∈ R N . (6)
We then choose the map A : { 0 , 1 } h → { 0 , 1 } N A : \{0,1\}^{h} \to\{0,1\}^{N} A : { 0 , 1 } h → { 0 , 1 } N to be an injective function such that
T ≠ T ′ ⟹ ( A ( T ) , A ( T ′ ) ) ∉ R N , (7) T \ne T' \Longrightarrow(A(T),A(T')) \notin R_N, \tag*{(7)} T = T ′ ⟹ ( A ( T ) , A ( T ′ )) ∈ / R N , (7)
and refer to such a map A A A as a tag code . Then, it is easy to see that if two codewords x ∥ A ( T ) x\mathbin\Vert A(T) x ∥ A ( T ) and x ′ ∥ A ( T ′ ) x'\mathbin\Vert A(T') x ′ ∥ A ( T ′ ) are confusable, then they must have the same tag T = T ′ T = T' T = T ′ , and hence share the exact same suffix s = A ( T ) s = A(T) s = A ( T ) .
Correctness and redundancy
Since the tag code A A A forces any two confusable codewords to share the same suffix s = A ( T ) s = A(T) s = A ( T ) , we only need to distinguish a payload x ∈ { 0 , 1 } m x \in\{0,1\}^{m} x ∈ { 0 , 1 } m from other payloads x ′ x' x ′ that can be confused with x x x when both are followed by the same suffix s s s . As the suffix s s s depends on the tag of x x x , we define the set of payload competitors of x x x by considering all possible common suffixes s ∈ { 0 , 1 } N s \in\{0,1\}^{N} s ∈ { 0 , 1 } N .
Γ E ( x ) = { x ′ ∈ { 0 , 1 } m ∖ { x } : ( x ∥ s ) ∼ n ( x ′ ∥ s ) for some s ∈ { 0 , 1 } N } . (8) \Gamma_{\mathcal{E}}(x) = \{x' \in\{0,1\}^{m} \setminus\{x\} : (x\mathbin\Vert s) \sim_n (x'\mathbin\Vert s) \text{ for some } s \in\{0,1\}^{N}\}. \tag*{(8)} Γ E ( x ) = { x ′ ∈ { 0 , 1 } m ∖ { x } : ( x ∥ s ) ∼ n ( x ′ ∥ s ) for some s ∈ { 0 , 1 } N } . (8)
In our constructions, it is convenient to work with a slightly larger set Γ ~ ( x ) \widetilde{\Gamma}(x) Γ ( x ) that is easier to list and satisfies
Γ E ( x ) ⊆ Γ ~ ( x ) ⊆ { 0 , 1 } m ∖ { x } , ∣ Γ ~ ( x ) ∣ ≤ L . (9) \Gamma_{\mathcal{E}}(x) \subseteq\widetilde{\Gamma}(x) \subseteq\{0,1\}^{m} \setminus\{x\}, \qquad|\widetilde{\Gamma}(x)| \le L. \tag*{(9)} Γ E ( x ) ⊆ Γ ( x ) ⊆ { 0 , 1 } m ∖ { x } , ∣ Γ ( x ) ∣ ≤ L . (9)
Applying the construction of § 2 with Γ ( x ) = Γ ~ ( x ) \Gamma(x)=\widetilde{\Gamma}(x) Γ ( x ) = Γ ( x ) gives the following lemma.
Lemma 3.2 (From tags to codes). Suppose that E n \mathcal{E}_n E n is ( m , N , R N ) (m,N,\mathcal{R}_N) ( m , N , R N ) -splittable and (9) holds. Let b , r b,r b , r satisfy (3) , let h = 2 b + r h=2b+r h = 2 b + r , and let A : { 0 , 1 } h → { 0 , 1 } N A:\{0,1\}^{h}\to\{0,1\}^{N} A : { 0 , 1 } h → { 0 , 1 } N be a tag code satisfying (7) . Then the encoder Enc \operatorname{Enc} Enc in (5) is injective, its image C C C corrects E n \mathcal{E}_n E n , and the redundancy of C C C is
n − log ∣ C ∣ = ( r + 2 ) + ( N − h ) . (10) n-\log|C|=(r+2)+(N-h). \tag*{(10)} n − log ∣ C ∣ = ( r + 2 ) + ( N − h ) . (10) In particular, setting r = ⌈ log ( 2 L ) ⌉ r=\lceil\log(2L)\rceil r = ⌈ log ( 2 L )⌉ gives redundancy at most log L + 4 + ( N − h ) \log L+4+(N-h) log L + 4 + ( N − h ) .
Proof. Suppose that two codewords x ∥ A ( T ) x\mathbin\Vert A(T) x ∥ A ( T ) and x ′ ∥ A ( T ′ ) x'\mathbin\Vert A(T') x ′ ∥ A ( T ′ ) are confusable. By (6) , we have ( A ( T ) , A ( T ′ ) ) ∈ R N (A(T),A(T'))\in\mathcal{R}_N ( A ( T ) , A ( T ′ )) ∈ R N , which by (7) implies T = T ′ T=T' T = T ′ . Thus the two codewords share the same suffix s = A ( T ) s=A(T) s = A ( T ) . If x ≠ x ′ x\ne x' x = x ′ , then ( x ∥ s ) ∼ n ( x ′ ∥ s ) (x\mathbin\Vert s)\sim_n(x'\mathbin\Vert s) ( x ∥ s ) ∼ n ( x ′ ∥ s ) means x ′ ∈ Γ E ( x ) ⊆ Γ ~ ( x ) x'\in\Gamma_{\mathcal{E}}(x)\subseteq\widetilde{\Gamma}(x) x ′ ∈ Γ E ( x ) ⊆ Γ ( x ) , which contradicts Theorem 2.1(a) since T = T ′ T=T' T = T ′ . Hence we must have x = x ′ x=x' x = x ′ , and Theorem 2.1(b) then implies that the additional message bits ( σ , τ ) (\sigma,\tau) ( σ , τ ) are also equal. Thus distinct messages map to non-confusable codewords.
Since each message consists of m + 2 b − 2 m+2b-2 m + 2 b − 2 bits and each codeword has length n = m + N n=m+N n = m + N , the redundancy of C C C is n − log ∣ C ∣ = ( m + N ) − ( m + 2 b − 2 ) = ( r + 2 ) + ( N − h ) n-\log|C|=(m+N)-(m+2b-2)=(r+2)+(N-h) n − log ∣ C ∣ = ( m + N ) − ( m + 2 b − 2 ) = ( r + 2 ) + ( N − h ) , and the last claim follows from Theorem 2.1(c). ∎
Decoding. Given a received word y y y , let E n − 1 ( y ) = { z ∈ { 0 , 1 } n : y ∈ E n ( z ) } \mathcal{E}_n^{-1}(y)=\{z\in\{0,1\}^{n}:y\in\mathcal{E}_n(z)\} E n − 1 ( y ) = { z ∈ { 0 , 1 } n : y ∈ E n ( z )} be the set of all length-n n n inputs that can produce y y y . Suppose we can list E n − 1 ( y ) \mathcal{E}_n^{-1}(y) E n − 1 ( y ) , test membership in A ( { 0 , 1 } h ) A(\{0,1\}^{h}) A ({ 0 , 1 } h ) and invert A A A on its image. Since every candidate z ∈ E n − 1 ( y ) z\in\mathcal{E}_n^{-1}(y) z ∈ E n − 1 ( y ) has length n = m + N n=m+N n = m + N , we can split z = x ′ ∥ u z=x'\mathbin\Vert u z = x ′ ∥ u at the known prefix length ∣ x ′ ∣ = m |x'|=m ∣ x ′ ∣ = m without knowing the boundary in y y y . For each candidate z = x ′ ∥ u ∈ E n − 1 ( y ) z=x'\mathbin\Vert u\in\mathcal{E}_n^{-1}(y) z = x ′ ∥ u ∈ E n − 1 ( y ) such that u = A ( T ′ ) u=A(T') u = A ( T ′ ) for some tag T ′ = φ − 1 ( a ′ ) ∥ φ − 1 ( λ ′ ) ∥ η ′ T'=\varphi^{-1}(a')\mathbin\Vert\varphi^{-1}(\lambda')\mathbin\Vert\eta' T ′ = φ − 1 ( a ′ ) ∥ φ − 1 ( λ ′ ) ∥ η ′ , we check whether
π ( λ ′ P x ′ ( a ′ ) ) = η ′ . (11) \pi(\lambda'P_{x'}(a'))=\eta'. \tag*{(11)} π ( λ ′ P x ′ ( a ′ )) = η ′ . (11)
and stop at the first candidate z z z that satisfies this equality. If a candidate passes the hash test, the decoder reconstructs the two good-seed sets in turn, checks that each seed lies among the first K K K elements of its set, and reads off ( σ , τ ) (\sigma,\tau) ( σ , τ ) from their ranks as in § 2 ; if no candidate passes the hash test or if either rank check fails, the decoder outputs failure.
To see that this correctly recovers the transmitted codeword c = x ∥ A ( T ) c=x\mathbin\Vert A(T) c = x ∥ A ( T ) , observe first that c ∈ E n − 1 ( y ) c\in\mathcal{E}_n^{-1}(y) c ∈ E n − 1 ( y ) and c c c passes the test (11) . If any other candidate z = x ′ ∥ A ( T ′ ) ∈ E n − 1 ( y ) z=x'\mathbin\Vert A(T')\in\mathcal{E}_n^{-1}(y) z = x ′ ∥ A ( T ′ ) ∈ E n − 1 ( y ) also passes, then z ∼ n c z\sim_n c z ∼ n c , so splittability and (7) imply T ′ = T T'=T T ′ = T . If x ′ ≠ x x'\ne x x ′ = x , then x ′ ∈ Γ E ( x ) ⊆ Γ ~ ( x ) x'\in\Gamma_{\mathcal{E}}(x)\subseteq\widetilde{\Gamma}(x) x ′ ∈ Γ E ( x ) ⊆ Γ ( x ) , and since the seeds a , λ a,\lambda a , λ in T T T are good for x x x , the equality (11) cannot hold for x ′ x' x ′ . Thus z = c z=c z = c is the unique candidate in E n − 1 ( y ) \mathcal{E}_n^{-1}(y) E n − 1 ( y ) that passes (11) , and its seed ranks give ( σ , τ ) (\sigma,\tau) ( σ , τ ) .
An efficient construction
It remains to construct a tag code A : { 0 , 1 } h → { 0 , 1 } N A:\{0,1\}^{h}\to\{0,1\}^{N} A : { 0 , 1 } h → { 0 , 1 } N with small overhead N − h N-h N − h . Let D N = max s ∈ { 0 , 1 } N ∣ { s ′ ∈ { 0 , 1 } N : ( s , s ′ ) ∈ R N } ∣ D_N=\max_{s\in\{0,1\}^{N}}|\{s'\in\{0,1\}^{N}:(s,s')\in\mathcal{R}_N\}| D N = max s ∈ { 0 , 1 } N ∣ { s ′ ∈ { 0 , 1 } N : ( s , s ′ ) ∈ R N } ∣ be the maximum degree of the relation R N \mathcal{R}_N R N . A simple greedy procedure finds at least 2 N / D N 2^{N}/D_N 2 N / D N strings in { 0 , 1 } N \{0,1\}^{N} { 0 , 1 } N that are pairwise unrelated under R N \mathcal{R}_N R N : we scan { 0 , 1 } N \{0,1\}^{N} { 0 , 1 } N in lexicographic order, select the first unmarked string s s s , mark all strings s ′ s' s ′ with ( s , s ′ ) ∈ R N (s,s')\in\mathcal{R}_N ( s , s ′ ) ∈ R N , and repeat. Since each step marks at most D N D_N D N strings, we obtain a tag code A A A of size 2 h 2^{h} 2 h whenever
2 N − h ≥ D N . (12) 2^{N-h}\ge D_N. \tag*{(12)} 2 N − h ≥ D N . (12)
We can then store A A A and A − 1 A^{-1} A − 1 as lookup tables of size O ( 2 N ) O(2^N) O ( 2 N ) .
In our applications, the tag length is h = O ( log n ) h = O(\log n) h = O ( log n ) and the degree D N D_N D N is bounded by C N c CN^c C N c for constants C , c C,c C , c . By (12) , the extra redundancy needed to protect the tag is only N − h = c log log n + O ( 1 ) N-h = c\log\log n + O(1) N − h = c log log n + O ( 1 ) bits. Furthermore, since N = O ( log n ) N = O(\log n) N = O ( log n ) , the greedy construction of A A A runs in time 2 O ( log n ) = poly ( n ) 2^{O(\log n)} = \operatorname{poly}(n) 2 O ( l o g n ) = poly ( n ) . We summarize this general construction in the following theorem.
Theorem 3.3 (Efficient codes for splittable channels). Let E \mathcal{E} E be a channel, let c ≥ 0 c \ge0 c ≥ 0 and C ≥ 1 C \ge1 C ≥ 1 be constants, and let L = L ( n ) ≥ 1 L = L(n) \ge1 L = L ( n ) ≥ 1 be an integer computable from n n n in poly ( n ) \operatorname{poly}(n) poly ( n ) time, with log L = O ( log n ) \log L = O(\log n) log L = O ( log n ) . Suppose that, for all sufficiently large n n n and every split n = m + N n = m + N n = m + N with 1 ≤ N ≤ n / 2 1 \le N \le n/2 1 ≤ N ≤ n /2 , the following hold. All listing algorithms below are uniform and deterministic.
(a) there is a reflexive symmetric relation R N R_N R N with D N ≤ C N c D_N \le CN^c D N ≤ C N c such that E n \mathcal{E}_n E n is ( m , N , R N ) (m,N,R_N) ( m , N , R N ) -splittable, and the R N R_N R N -neighborhood of any s ∈ { 0 , 1 } N s \in\{0,1\}^N s ∈ { 0 , 1 } N can be listed in poly ( N ) \operatorname{poly}(N) poly ( N ) time;
(b) for each x ∈ { 0 , 1 } m x \in\{0,1\}^m x ∈ { 0 , 1 } m , a set Γ ~ ( x ) \widetilde{\Gamma}(x) Γ ( x ) satisfying (9) can be listed in poly ( n ) \operatorname{poly}(n) poly ( n ) time;
(c) for every string y y y , the set E n − 1 ( y ) \mathcal{E}_n^{-1}(y) E n − 1 ( y ) can be listed in poly ( n + ∣ y ∣ ) \operatorname{poly}(n+|y|) poly ( n + ∣ y ∣ ) time.
Then, for all sufficiently large n n n , there is an explicit code C ⊆ { 0 , 1 } n \mathcal{C} \subseteq\{0,1\}^n C ⊆ { 0 , 1 } n correcting E n \mathcal{E}_n E n with redundancy
n − log ∣ C ∣ ≤ log L + c log log n + O ( 1 ) , (13) n-\log|\mathcal{C}| \le\log L + c\log\log n + O(1), \tag*{(13)} n − log ∣ C ∣ ≤ log L + c log log n + O ( 1 ) , (13) with deterministic poly ( n ) \operatorname{poly}(n) poly ( n ) -time encoding and poly ( n + ∣ y ∣ ) \operatorname{poly}(n+|y|) poly ( n + ∣ y ∣ ) -time decoding.
Proof. Given n n n , we set b = ⌈ log ( 2 L n ) ⌉ b = \lceil\log(2Ln)\rceil b = ⌈ log ( 2 L n )⌉ , r = ⌈ log ( 2 L ) ⌉ r = \lceil\log(2L)\rceil r = ⌈ log ( 2 L )⌉ , and h = 2 b + r h = 2b+r h = 2 b + r . We then choose N = h + ⌈ c log ( 2 h ) + log C ⌉ N = h+\lceil c\log(2h)+\log C\rceil N = h + ⌈ c log ( 2 h ) + log C ⌉ and m = n − N m=n-N m = n − N . Since h = O ( log n ) h = O(\log n) h = O ( log n ) , we have N ≤ 2 h ≤ n / 2 N \le2h \le n/2 N ≤ 2 h ≤ n /2 for large enough n n n . It is easy to check that b b b and r r r satisfy (3) , and that D N ≤ C N c ≤ C ( 2 h ) c ≤ 2 N − h D_N \le CN^c \le C(2h)^c \le2^{N-h} D N ≤ C N c ≤ C ( 2 h ) c ≤ 2 N − h , so (12) holds and the greedy procedure yields the tag code A A A .
Since 2 b = O ( L n ) 2^b = O(Ln) 2 b = O ( L n ) and 2 N = 2 h ⋅ O ( h c ) = O ( L 3 n 2 log c n ) 2^N = 2^h \cdot O(h^c) = O(L^3n^2\log^c n) 2 N = 2 h ⋅ O ( h c ) = O ( L 3 n 2 log c n ) are both polynomial in n n n , we can find an irreducible polynomial of degree b b b over F 2 \mathbb{F}_2 F 2 and construct the lookup tables for A A A and A − 1 A^{-1} A − 1 in poly ( n ) \operatorname{poly}(n) poly ( n ) time using (a). By (b) and (c), the encoder (5) runs in poly ( n ) \operatorname{poly}(n) poly ( n ) and the decoder runs in poly ( n + ∣ y ∣ ) \operatorname{poly}(n+|y|) poly ( n + ∣ y ∣ ) time. Finally, by Lemma 3.2, the redundancy is ( r + 2 ) + ( N − h ) ≤ log L + c log log n + O ( 1 ) (r+2)+(N-h) \le\log L+c\log\log n+O(1) ( r + 2 ) + ( N − h ) ≤ log L + c log log n + O ( 1 ) . □ \square □
In the next section, we verify that the Damerau–Levenshtein channel satisfies the conditions of Theorem 3.3 with R N R_N R N equal to the confusion relation ∼ N \sim_N ∼ N of E N \mathcal{E}_N E N itself. When a channel is self-splittable, any code correcting E N \mathcal{E}_N E N can serve as the tag code A A A . In Appendix D, we use our own code construction at length N = O ( log n ) N=O(\log n) N = O ( log n ) as the tag code A A A , which reduces the precomputation time of A A A from poly ( n ) \operatorname{poly}(n) poly ( n ) to polylog ( n ) \operatorname{polylog}(n) polylog ( n ) .
Codes in the Damerau–Levenshtein metric
A Damerau–Levenshtein (D L DL D L ) operation is an insertion, deletion, substitution, or adjacent transposition u i u i + 1 ↦ u i + 1 u i u_i u_{i+1} \mapsto u_{i+1}u_i u i u i + 1 ↦ u i + 1 u i , and d D L ( u , v ) d_{\mathrm{DL}}(u,v) d DL ( u , v ) is the minimum number of DL operations transforming u u u into v v v , [11 ] . Every operation is undone by one of the allowed operations, so d D L d_{\mathrm{DL}} d DL is a graph metric, and d D L ≤ d L ≤ 2 d D L d_{\mathrm{DL}} \le d_{\mathrm{L}} \le2d_{\mathrm{DL}} d DL ≤ d L ≤ 2 d DL since a transposition is two substitutions. Let B q ( u ) = { v ∈ { 0 , 1 } ∗ : d D L ( u , v ) ≤ q } B_q(u)=\{v\in\{0,1\}^*:d_{\mathrm{DL}}(u,v)\le q\} B q ( u ) = { v ∈ { 0 , 1 } ∗ : d DL ( u , v ) ≤ q } . As for edits, a code corrects t t t DL errors (the channel E n ( u ) = B t ( u ) \mathcal{E}_n(u)=B_t(u) E n ( u ) = B t ( u ) ) if and only if its codewords are at pairwise DL distance at least 2 t + 1 2t+1 2 t + 1 , so
u ∼ n u ′ ⟺ d D L ( u , u ′ ) ≤ 2 t . (14) u\sim_n u' \quad\Longleftrightarrow\quad d_{\mathrm{DL}}(u,u')\le2t. \tag*{(14)} u ∼ n u ′ ⟺ d DL ( u , u ′ ) ≤ 2 t . (14)
Splitting at a fixed boundary
To show that the DL channel is splittable, we track a boundary marker between the payload and the suffix through a sequence of DL operations.
Lemma 4.1 (Projection at a fixed boundary). For all x , x ′ ∈ { 0 , 1 } m x,x' \in\{0,1\}^{m} x , x ′ ∈ { 0 , 1 } m and s , s ′ ∈ { 0 , 1 } N s,s' \in\{0,1\}^{N} s , s ′ ∈ { 0 , 1 } N ,
max { d D L ( x , x ′ ) , d D L ( s , s ′ ) } ≤ d D L ( x ∥ s , x ′ ∥ s ′ ) . (15) \max\{d_{\mathrm{DL}}(x,x'),d_{\mathrm{DL}}(s,s')\} \le d_{\mathrm{DL}}(x\|s,x'\|s'). \tag*{(15)} max { d DL ( x , x ′ ) , d DL ( s , s ′ )} ≤ d DL ( x ∥ s , x ′ ∥ s ′ ) . (15) Proof. Let k = d D L ( x ∥ s , x ′ ∥ s ′ ) k=d_{\mathrm{DL}}(x\|s,x'\|s') k = d DL ( x ∥ s , x ′ ∥ s ′ ) , and let w 0 = x ∥ s , w 1 , … , w k = x ′ ∥ s ′ w_0=x\|s,w_1,\ldots,w_k=x'\|s' w 0 = x ∥ s , w 1 , … , w k = x ′ ∥ s ′ be any sequence of k k k operations. We maintain a factorization w i = ℓ i ∥ ρ i w_i=\ell_i\|\rho_i w i = ℓ i ∥ ρ i , starting from ( ℓ 0 , ρ 0 ) = ( x , s ) (\ell_0,\rho_0)=(x,s) ( ℓ 0 , ρ 0 ) = ( x , s ) . An operation confined to one side of the marker is applied to that part (with an insertion at the marker appended to ℓ i \ell_i ℓ i ). A transposition straddling the marker swaps the last symbol of ℓ i \ell_i ℓ i with the first symbol of ρ i \rho_i ρ i , which changes ρ i \rho_i ρ i by at most one substitution and leaves ∣ ℓ i ∣ |\ell_i| ∣ ℓ i ∣ unchanged.
By induction on i i i , we have the invariant d D L ( s , ρ i ) + ∣ ℓ i ∣ − m ≤ i d_{\mathrm{DL}}(s,\rho_i)+|\ell_i|-m\le i d DL ( s , ρ i ) + ∣ ℓ i ∣ − m ≤ i . Indeed, each operation on the left changes ∣ ℓ i ∣ |\ell_i| ∣ ℓ i ∣ by at most one and leaves ρ i \rho_i ρ i unchanged, while each operation on the right or straddling the marker leaves ∣ ℓ i ∣ |\ell_i| ∣ ℓ i ∣ unchanged and changes ρ i \rho_i ρ i by at most one DL operation.
At i = k i=k i = k , write x ′ ∥ s ′ = ℓ k ∥ ρ k x'\|s'=\ell_k\|\rho_k x ′ ∥ s ′ = ℓ k ∥ ρ k and j = ∣ ℓ k ∣ j=|\ell_k| j = ∣ ℓ k ∣ . Whether j ≥ m j\ge m j ≥ m or j < m j<m j < m , the suffix s ′ s' s ′ is obtained from ρ k \rho_k ρ k by at most ∣ j − m ∣ |j-m| ∣ j − m ∣ insertions or deletions at its beginning, so d D L ( s , s ′ ) ≤ d D L ( s , ρ k ) + ∣ j − m ∣ ≤ k d_{\mathrm{DL}}(s,s')\le d_{\mathrm{DL}}(s,\rho_k)+|j-m|\le k d DL ( s , s ′ ) ≤ d DL ( s , ρ k ) + ∣ j − m ∣ ≤ k .
Finally, since string reversal preserves d D L d_{\mathrm{DL}} d DL and swaps prefixes with suffixes, applying the same bound to the reversed strings gives d D L ( x , x ′ ) ≤ k d_{\mathrm{DL}}(x,x')\le k d DL ( x , x ′ ) ≤ k .
Example. Let m = N = 3 m=N=3 m = N = 3 , x = 011 x=011 x = 011 , and s = 001 s=001 s = 001 . Applying a straddling transposition at positions 3, 4, deleting the first bit, and appending 0 gives
011 ∥ 001 ⟶ 010 ∥ 101 ⟶ 10 ∥ 101 ⟶ 10 ∥ 1010 , 011\|001 \longrightarrow010\|101 \longrightarrow10\|101 \longrightarrow10\|1010, 011∥001 ⟶ 010∥101 ⟶ 10∥101 ⟶ 10∥1010 ,
where the bar tracks ℓ i ∥ ρ i \ell_i\|\rho_i ℓ i ∥ ρ i . Splitting the final word at m = 3 m=3 m = 3 gives x ′ = 101 x'=101 x ′ = 101 and s ′ = 010 s'=010 s ′ = 010 . Here ρ 3 = 1010 \rho_3=1010 ρ 3 = 1010 differs from s s s by two operations and ∣ ℓ 3 ∣ = 2 |\ell_3|=2 ∣ ℓ 3 ∣ = 2 , so s ′ s' s ′ is obtained from ρ 3 \rho_3 ρ 3 by deleting its first bit and d D L ( s , s ′ ) ≤ 2 + ∣ 2 − 3 ∣ = 3 d_{\mathrm{DL}}(s,s')\le2+|2-3|=3 d DL ( s , s ′ ) ≤ 2 + ∣2 − 3∣ = 3 .
Taking R N \mathcal{R}_N R N to be the confusion relation d D L ( s , s ′ ) ≤ 2 t d_{\mathrm{DL}}(s,s')\le2t d DL ( s , s ′ ) ≤ 2 t on { 0 , 1 } N \{0,1\}^{N} { 0 , 1 } N , Lemma 4.1 shows that the t t t -DL channel is self-splittable.
Enumerating the competitors
Lemma 4.1 also pins down the exact payload competitor set Γ E ( x ) \Gamma_E(x) Γ E ( x ) from (8) .
Corollary 4.2 (Payload competitors). For any x , x ′ ∈ { 0 , 1 } m x,x'\in\{0,1\}^{m} x , x ′ ∈ { 0 , 1 } m and s ∈ { 0 , 1 } N s\in\{0,1\}^{N} s ∈ { 0 , 1 } N , we have d D L ( x ∥ s , x ′ ∥ s ) = d D L ( x , x ′ ) d_{\mathrm{DL}}(x\|s,x'\|s)=d_{\mathrm{DL}}(x,x') d DL ( x ∥ s , x ′ ∥ s ) = d DL ( x , x ′ ) . Consequently, for the t t t -DL channel,
Γ E ( x ) = Γ D L ( x ) : = B 2 t ( x ) ∩ { 0 , 1 } m ∖ { x } . (16) \Gamma_E(x)=\Gamma_{\mathrm{DL}}(x):=B_{2t}(x)\cap\{0,1\}^{m}\setminus\{x\}. \tag*{(16)} Γ E ( x ) = Γ DL ( x ) := B 2 t ( x ) ∩ { 0 , 1 } m ∖ { x } . (16) Proof. Lemma 4.1 gives d D L ( x , x ′ ) ≤ d D L ( x ∥ s , x ′ ∥ s ) d_{\mathrm{DL}}(x,x')\le d_{\mathrm{DL}}(x\|s,x'\|s) d DL ( x , x ′ ) ≤ d DL ( x ∥ s , x ′ ∥ s ) , and the reverse inequality follows by applying a shortest operation sequence from x x x to x ′ x' x ′ to the prefix of x ∥ s x\|s x ∥ s . Equation (16) then follows from (8) and (14) .
A string of length ℓ ′ \ell' ℓ ′ admits 2 ( ℓ ′ + 1 ) 2(\ell'+1) 2 ( ℓ ′ + 1 ) insertions, ℓ ′ \ell' ℓ ′ deletions, ℓ ′ \ell' ℓ ′ substitutions, and at most ℓ ′ \ell' ℓ ′ adjacent transpositions, for a total of at most 5 ℓ ′ + 2 5\ell'+2 5 ℓ ′ + 2 operations. Thus, for any u ∈ { 0 , 1 } ℓ u\in\{0,1\}^{\ell} u ∈ { 0 , 1 } ℓ , applying all sequences of at most q q q operations lists B q ( u ) B_q(u) B q ( u ) in at most M ( ℓ , q ) = ( q + 1 ) ( 5 ( ℓ + q ) + 2 ) q M(\ell,q)=(q+1)(5(\ell+q)+2)^q M ( ℓ , q ) = ( q + 1 ) ( 5 ( ℓ + q ) + 2 ) q entries and time O ( M ( ℓ , q ) ( ℓ + q + 1 ) ) O(M(\ell,q)(\ell+q+1)) O ( M ( ℓ , q ) ( ℓ + q + 1 )) . Assuming n ≥ 2 t + 1 n\ge2t+1 n ≥ 2 t + 1 , this gives all three lists required in § 3 :
Competitors: Filtering the list of B 2 t ( x ) B_{2t}(x) B 2 t ( x ) for strings of length m m m different from x x x lists Γ D L ( x ) \Gamma_{\mathrm{DL}}(x) Γ DL ( x ) in time O t ( n 2 t + 1 ) O_t(n^{2t+1}) O t ( n 2 t + 1 ) with at most L = D t D L n 2 t L = D_t^{\mathrm{DL}}n^{2t} L = D t DL n 2 t and D t D L = ( 2 t + 1 ) 10 2 t D_t^{\mathrm{DL}} = (2t+1)10^{2t} D t DL = ( 2 t + 1 ) 1 0 2 t entries.
Suffix neighborhoods: For N ≥ 2 t + 1 N \ge2t+1 N ≥ 2 t + 1 , the R N \mathcal{R}_N R N -neighborhood B 2 t ( s ) ∩ { 0 , 1 } N B_{2t}(s) \cap\{0,1\}^{N} B 2 t ( s ) ∩ { 0 , 1 } N has size at most D N ≤ ( 2 t + 1 ) ( 10 N ) 2 t D_N \le(2t+1)(10N)^{2t} D N ≤ ( 2 t + 1 ) ( 10 N ) 2 t . For 1 ≤ N ≤ 2 t 1 \le N \le2t 1 ≤ N ≤ 2 t , we have D N ≤ 2 N ≤ 2 2 t ≤ D t D L N 2 t D_N \le2^N \le2^{2t} \le D_t^{\mathrm{DL}}N^{2t} D N ≤ 2 N ≤ 2 2 t ≤ D t DL N 2 t .
Preimages: For any received word y y y of length in [ n − t , n + t ] [n-t,n+t] [ n − t , n + t ] , the preimage set E n − 1 ( y ) = B t ( y ) ∩ { 0 , 1 } n \mathcal{E}_n^{-1}(y) = B_t(y) \cap\{0,1\}^n E n − 1 ( y ) = B t ( y ) ∩ { 0 , 1 } n is listed with O t ( n t ) O_t(n^t) O t ( n t ) entries in time O t ( n t + 1 ) O_t(n^{t+1}) O t ( n t + 1 ) .
The resulting codes
Setting b = ⌈ log ( 2 L n ) ⌉ b = \lceil\log(2Ln)\rceil b = ⌈ log ( 2 L n )⌉ , r = ⌈ log ( 2 L ) ⌉ r = \lceil\log(2L)\rceil r = ⌈ log ( 2 L )⌉ , and h = 2 b + r h = 2b+r h = 2 b + r with L = D t D L n 2 t L = D_t^{\mathrm{DL}}n^{2t} L = D t DL n 2 t , and applying the encoder (5) with either a greedy or a bootstrapped tag code A : { 0 , 1 } h → { 0 , 1 } N A:\{0,1\}^h \to\{0,1\}^N A : { 0 , 1 } h → { 0 , 1 } N , we obtain our main result (Theorem 1.1 ).
Theorem 4.3 (Damerau–Levenshtein codes). For every fixed t ≥ 1 t \ge1 t ≥ 1 and all sufficiently large n n n , there are explicit binary codes C ⊆ { 0 , 1 } n C \subseteq\{0,1\}^n C ⊆ { 0 , 1 } n correcting any combination of at most t t t insertions, deletions, substitutions, and adjacent transpositions, in two variants:
(a) (bootstrapped) with precomputation time polylog ( n ) \operatorname{polylog}(n) polylog ( n ) and redundancy n − log ∣ C ∣ ≤ 2 t log n + 2 t log log n + O t ( log log log n ) n-\log|C| \le2t\log n + 2t\log\log n + O_t(\log\log\log n) n − log ∣ C ∣ ≤ 2 t log n + 2 t log log n + O t ( log log log n ) ;
(b) (greedy) with precomputation time n 6 t + 2 + o ( 1 ) n^{6t+2+o(1)} n 6 t + 2 + o ( 1 ) and redundancy n − log ∣ C ∣ ≤ 2 t log n + 2 t log log n + O t ( 1 ) n-\log|C| \le2t\log n + 2t\log\log n + O_t(1) n − log ∣ C ∣ ≤ 2 t log n + 2 t log log n + O t ( 1 ) .
In both variants, encoding and full-message decoding take O t ( n 2 t + 2 log 2 n ) O_t(n^{2t+2}\log^2 n) O t ( n 2 t + 2 log 2 n ) bit operations, and the payload (the first n − O t ( log n ) n-O_t(\log n) n − O t ( log n ) bits of the codeword) is recovered in O t ( n t + 1 log n ) O_t(n^{t+1}\log n) O t ( n t + 1 log n ) bit operations.
Proof. By Lemma 4.1 , Corollary 4.2 , and Lemma 3.2 , the code C C C corrects t t t DL errors and has redundancy
n − log ∣ C ∣ = ( r + 2 ) + ( N − h ) , r + 2 ≤ 2 t log n + log D t D L + 4. (17) n-\log|C|=(r+2)+(N-h), \qquad r+2\le2t\log n+\log D_t^{\mathrm{DL}}+4. \tag*{(17)} n − log ∣ C ∣ = ( r + 2 ) + ( N − h ) , r + 2 ≤ 2 t log n + log D t DL + 4. (17)
For variant (b), we set N = h + ⌈ 2 t log ( 20 h ) + log ( 2 t + 1 ) ⌉ N=h+\lceil2t\log(20h)+\log(2t+1)\rceil N = h + ⌈ 2 t log ( 20 h ) + log ( 2 t + 1 )⌉ . For large n n n , we have 2 t + 1 ≤ N ≤ 2 h 2t+1\le N\le2h 2 t + 1 ≤ N ≤ 2 h , so D N ≤ ( 2 t + 1 ) ( 10 N ) 2 t ≤ ( 2 t + 1 ) ( 20 h ) 2 t ≤ 2 N − h D_N\le(2t+1)(10N)^{2t}\le(2t+1)(20h)^{2t}\le2^{N-h} D N ≤ ( 2 t + 1 ) ( 10 N ) 2 t ≤ ( 2 t + 1 ) ( 20 h ) 2 t ≤ 2 N − h . Since h = ( 6 t + 2 ) log n + O t ( 1 ) h=(6t+2)\log n+O_t(1) h = ( 6 t + 2 ) log n + O t ( 1 ) , the greedy construction of § 3.3 yields a tag code A A A with N − h = 2 t log log n + O t ( 1 ) N-h=2t\log\log n+O_t(1) N − h = 2 t log log n + O t ( 1 ) in time O t ( 2 N N 2 t + 1 ) = n 6 t + 2 + o ( 1 ) O_t(2^N N^{2t+1})=n^{6t+2+o(1)} O t ( 2 N N 2 t + 1 ) = n 6 t + 2 + o ( 1 ) . The outer field can be constructed in poly ( b ) = polylog ( n ) \operatorname{poly}(b)=\operatorname{polylog}(n) poly ( b ) = polylog ( n ) time by Appendix § 8 .§ 1 , so the total precomputation time for variant (b) remains n 6 t + 2 + o ( 1 ) n^{6t+2+o(1)} n 6 t + 2 + o ( 1 ) .
For variant (a), since the DL channel is self-splittable, we can apply bootstrapping (Lemma D.1 ) to the greedy family at length N h ≤ 2 h = O t ( log n ) N_h\le2h=O_t(\log n) N h ≤ 2 h = O t ( log n ) . This yields a tag code A h A_h A h with overhead N h − h ≤ 2 t log h + 2 t log log h + O t ( 1 ) = 2 t log log n + O t ( log log log n ) N_h-h\le2t\log h+2t\log\log h+O_t(1)=2t\log\log n+O_t(\log\log\log n) N h − h ≤ 2 t log h + 2 t log log h + O t ( 1 ) = 2 t log log n + O t ( log log log n ) and precomputation time ( 2 h ) 6 t + 2 + o ( 1 ) = polylog ( n ) (2h)^{6t+2+o(1)}=\operatorname{polylog}(n) ( 2 h ) 6 t + 2 + o ( 1 ) = polylog ( n ) .
Finally, let τ A \tau_A τ A be the time per tag-code operation (τ A = O t ( log n ) \tau_A=O_t(\log n) τ A = O t ( log n ) for (b) and τ A = polylog ( n ) \tau_A=\operatorname{polylog}(n) τ A = polylog ( n ) for (a)). By Lemma C.5 , computing the tag or recovering the seed ranks from L = O t ( n 2 t ) L=O_t(n^{2t}) L = O t ( n 2 t ) competitors takes O t ( n 2 t + 2 log 2 n ) O_t(n^{2t+2}\log^2 n) O t ( n 2 t + 2 log 2 n ) bit operations. During decoding, testing each of the O t ( n t ) O_t(n^t) O t ( n t ) candidates in E n − 1 ( y ) \mathcal{E}_n^{-1}(y) E n − 1 ( y ) takes τ A \tau_A τ A time for the suffix and O t ( n log n ) O_t(n\log n) O t ( n log n ) bit operations for Horner’s rule, giving O t ( n t + 1 log n ) O_t(n^{t+1}\log n) O t ( n t + 1 log n ) bit operations to recover the payload and O t ( n 2 t + 2 log 2 n ) O_t(n^{2t+2}\log^2 n) O t ( n 2 t + 2 log 2 n ) bit operations to recover the full message. □ \square □
Discussion and open problems
Our codes match the leading term 2 t log n 2t\log n 2 t log n of the greedy Gilbert–Varshamov bound for every fixed t ≥ 1 t\ge1 t ≥ 1 , resolving the long-standing factor-of-two bottleneck for mixed synchronization errors. Because our primary focus is explicitness, the construction leaves several compelling open problems.
Explicit codes matching the ( 2 t − 1 ) log n (2t - 1)\log n ( 2 t − 1 ) log n existential bound. For every fixed t ≥ 2 t \ge2 t ≥ 2 , En Gad [13 ] recently proved non-constructively that ( 2 t − 1 ) log n + O t ( log log n ) (2t - 1)\log n + O_t(\log\log n) ( 2 t − 1 ) log n + O t ( log log n ) redundancy suffices for deletions, for general edits, and for Damerau–Levenshtein errors. In our framework, matching this existential bound would require reducing the net tag cost from log L + O ( 1 ) \log L + O(1) log L + O ( 1 ) to roughly 2 t − 1 2 t log L + O ( 1 ) \frac{2t-1}{2t}\log L + O(1) 2 t 2 t − 1 log L + O ( 1 ) on the confusion graph. Can seed recycling be combined with the substring-counting invariants of [13 ] to construct explicit codes with redundancy ( 2 t − 1 ) log n + o ( log n ) (2t - 1)\log n + o(\log n) ( 2 t − 1 ) log n + o ( log n ) ? Even for two deletions, constructing explicit codes with redundancy 3 log n + o ( log n ) 3\log n + o(\log n) 3 log n + o ( log n ) remains open.
Optimal redundancy beyond 2 t − 1 2t - 1 2 t − 1 . While En Gad’s results [13 ] lower the existential upper bound from 2 t log n 2t\log n 2 t log n to ( 2 t − 1 ) log n (2t - 1)\log n ( 2 t − 1 ) log n for all three error models, a significant gap remains to the sphere-packing lower bound of t log n − O t ( 1 ) t\log n - O_t(1) t log n − O t ( 1 ) . Can the existential leading coefficient be reduced below 2 t − 1 2t - 1 2 t − 1 for any of these channels? Determining the true optimal redundancy for constant t ≥ 2 t \ge2 t ≥ 2 errors remains a fundamental challenge in combinatorial coding theory.
Efficiency and broader channel models. Like previous explicit constructions based on syndrome compression or graph coloring [41 , 28 ] , our encoding and decoding times contain t t t in the exponent, stemming from the explicit enumeration of the ball B 2 t ( x ) B_{2t}(x) B 2 t ( x ) to form the competitor list. A major algorithmic challenge is to construct explicit codes matching the 2 t log n 2t\log n 2 t log n bound with encoding and decoding times f ( t ) ⋅ n O ( 1 ) f(t)\cdot n^{O(1)} f ( t ) ⋅ n O ( 1 ) whose polynomial degree is independent of t t t . Finally, it is natural to investigate whether seed recycling can be extended to the related channels discussed in § 1 , including q q q -ary deletion channels, permutation codes, and burst errors.
Summary tables and notation
Tables 3–5 provide a fuller comparison of our codes (variant (a) of Theorem 1.1 , which has deterministic poly(n n n )-time encoding and decoding after polylog(n n n )-time precomputation) with prior explicit constructions, existential upper bounds, and sphere-packing lower bounds for t t t deletions, t t t edits, and t t t Damerau–Levenshtein errors. Bounds marked † are consequences of the coloring framework of [28 ] . Table 6 summarizes the main global notation of the paper. Throughout, logarithms are to base two, t ≥ 1 t \ge1 t ≥ 1 is fixed, and constants in O t ( ⋅ ) O_t(\cdot) O t ( ⋅ ) depend only on $t.
Table 6. Summary of main notation.
Derivation of the bounds marked †
Here we briefly record how the two bounds marked † in Table 4 , and Table 5 follow from the coloring framework of Li, Gabrys, and Farnoud [28 ] . Throughout, t ≥ 2 t\ge2 t ≥ 2 is fixed, m m m is the payload length,
Table 4. Binary codes correcting edits (insertions, deletions, and substitutions). A row “t t t deletions + s s s substitutions” guarantees correction of up to t t t deletions and up to s s s substitutions, which is weaker than correcting any t + s t+s t + s edits.
Table 5. Binary codes in the Damerau–Levenshtein metric (insertions, deletions, substitutions, and adjacent transpositions).
In each derivation below, h h h denotes the length of the syndrome under consideration, independently of the seed-recycling parameters.
General edits. Let Φ 1 ( x ) \Phi_1(x) Φ 1 ( x ) be Levenshtein’s single-edit syndrome of length log m + O ( 1 ) \log m + O(1) log m + O ( 1 ) [25 ] . Applying [28 ] , Theorem 5 to extend this single-edit syndrome to correction of t t t edits gives an additional syndrome Φ t ∣ 1 ( x ) \Phi_{t\mid1}(x) Φ t ∣ 1 ( x ) of length ( 4 t − 2 ) log m + O t ( log log m ) (4t - 2)\log m + O_t(\log\log m) ( 4 t − 2 ) log m + O t ( log log m ) such that S ( x ) = Φ 1 ( x ) ∥ Φ t ∣ 1 ( x ) S(x) = \Phi_1(x)\mathbin\Vert\Phi_{t\mid1}(x) S ( x ) = Φ 1 ( x ) ∥ Φ t ∣ 1 ( x ) separates x ∈ { 0 , 1 } m x \in\{0,1\}^m x ∈ { 0 , 1 } m from all strings within edit distance 2 t 2t 2 t , with total length h = ∣ S ( x ) ∣ ≤ ( 4 t − 1 ) log m + O t ( log log m ) h = |S(x)| \le(4t - 1)\log m + O_t(\log\log m) h = ∣ S ( x ) ∣ ≤ ( 4 t − 1 ) log m + O t ( log log m ) . Applying [28 ] , Theorem 3 at length h h h yields a secondary syndrome Ψ : { 0 , 1 } h → { 0 , 1 } ρ \Psi: \{0,1\}^h \to\{0,1\}^\rho Ψ : { 0 , 1 } h → { 0 , 1 } ρ of length ρ = O t ( log h ) \rho= O_t(\log h) ρ = O t ( log h ) , and [28 ] , Lemma 37 shows that x ↦ x ∥ S ( x ) ∥ Rep 2 t + 1 ( Ψ ( S ( x ) ) ) x \mapsto x\mathbin\Vert S(x)\mathbin\Vert\operatorname{Rep}_{2t+1}(\Psi(S(x))) x ↦ x ∥ S ( x ) ∥ Rep 2 t + 1 ( Ψ ( S ( x ))) (where Rep 2 t + 1 \operatorname{Rep}_{2t+1} Rep 2 t + 1 repeats each bit 2 t + 1 2t+1 2 t + 1 times) is a polynomialtime encodable and decodable t t t -edit-correcting code of redundancy n − m = h + ( 2 t + 1 ) ρ ≤ ( 4 t − 1 ) log n + O t ( log log n ) n-m=h+(2t+1)\rho\le(4t-1)\log n+O_t(\log\log n) n − m = h + ( 2 t + 1 ) ρ ≤ ( 4 t − 1 ) log n + O t ( log log n ) .
Damerau–Levenshtein errors. Every DL operation is a 2-substring edit (an adjacent transposition replaces a length-2 substring by its reversal). Thus, under the noiseless-syndrome convention of [28 Remark 1] , specializing [28 Theorem 6] to t t t 2-substring edits gives a polynomial-time computable syndrome Φ D L : { 0 , 1 } m → { 0 , 1 } h \Phi_{\mathrm{DL}}:\{0,1\}^{m}\to\{0,1\}^{h} Φ DL : { 0 , 1 } m → { 0 , 1 } h of length h = 4 t log m + O t ( log log m ) h=4t\log m+O_t(\log\log m) h = 4 t log m + O t ( log log m ) that assigns distinct syndromes to payloads at DL distance at most 2 t 2t 2 t . Encoding Φ D L ( x ) \Phi_{\mathrm{DL}}(x) Φ DL ( x ) with the greedy DL tag code A : { 0 , 1 } h → { 0 , 1 } N A:\{0,1\}^{h}\to\{0,1\}^{N} A : { 0 , 1 } h → { 0 , 1 } N of § 3.3 (which has overhead N − h = O t ( log h ) = O t ( log log m ) N-h=O_t(\log h)=O_t(\log\log m) N − h = O t ( log h ) = O t ( log log m ) and minimum DL distance at least 2 t + 1 2t+1 2 t + 1 ) gives the codeword c ( x ) = x ∥ A ( Φ D L ( x ) ) c(x)=x\mathbin\Vert A(\Phi_{\mathrm{DL}}(x)) c ( x ) = x ∥ A ( Φ DL ( x )) . By Lemma 4.1 , d D L ( c ( x ) , c ( x ′ ) ) ≤ 2 t d_{\mathrm{DL}}(c(x),c(x'))\le2t d DL ( c ( x ) , c ( x ′ )) ≤ 2 t implies both d D L ( x , x ′ ) ≤ 2 t d_{\mathrm{DL}}(x,x')\le2t d DL ( x , x ′ ) ≤ 2 t and d D L ( A ( Φ D L ( x ) ) , A ( Φ D L ( x ′ ) ) ) ≤ 2 t d_{\mathrm{DL}}(A(\Phi_{\mathrm{DL}}(x)),A(\Phi_{\mathrm{DL}}(x')))\le2t d DL ( A ( Φ DL ( x )) , A ( Φ DL ( x ′ ))) ≤ 2 t , which forces Φ D L ( x ) = Φ D L ( x ′ ) \Phi_{\mathrm{DL}}(x)=\Phi_{\mathrm{DL}}(x') Φ DL ( x ) = Φ DL ( x ′ ) and hence x = x ′ x=x' x = x ′ . The resulting code has redundancy N = 4 t log n + O t ( log log n ) N=4t\log n+O_t(\log\log n) N = 4 t log n + O t ( log log n ) and polynomial-time encoding and decoding.
Additional proofs and decoding details for Sections 2 and 3
We first record the direct consequence of § 2 when the tag is transmitted over a noiseless side channel, and then give the formal specification of the generic decoder from § 3 , including its behavior on arbitrary (possibly invalid) inputs needed for bootstrapping in Appendix § 9 .
Corollary B.1 (Recovery from a noiseless tag). Let E m \mathcal{E}_m E m be a channel on { 0 , 1 } m \{0,1\}^{m} { 0 , 1 } m whose confusion graph has maximum degree at most L ≥ 1 L\ge1 L ≥ 1 . Let Γ ( x ) \Gamma(x) Γ ( x ) be the neighborhood of x x x in this graph, and set b = ⌈ log ( 2 L m ) ⌉ b=\lceil\log(2Lm)\rceil b = ⌈ log ( 2 L m )⌉ and r = ⌈ log ( 2 L ) ⌉ r=\lceil\log(2L)\rceil r = ⌈ log ( 2 L )⌉ . If we transmit x ∈ { 0 , 1 } m x\in\{0,1\}^{m} x ∈ { 0 , 1 } m through E m \mathcal{E}_m E m and Tag ( x , σ , τ ) \operatorname{Tag}(x,\sigma,\tau) Tag ( x , σ , τ ) (where σ , τ ∈ { 0 , 1 } b − 1 \sigma,\tau\in\{0,1\}^{b-1} σ , τ ∈ { 0 , 1 } b − 1 ) over a noiseless side channel, then ( x , σ , τ ) (x,\sigma,\tau) ( x , σ , τ ) can be uniquely recovered from any output y ∈ E m ( x ) y\in\mathcal{E}_m(x) y ∈ E m ( x ) and the tag, with net redundancy ( 2 b + r ) − ( 2 b − 2 ) = r + 2 < log L + 4 (2b+r)-(2b-2)=r+2<\log L+4 ( 2 b + r ) − ( 2 b − 2 ) = r + 2 < log L + 4 . Moreover, suppose that L = m O ( 1 ) L=m^{O(1)} L = m O ( 1 ) is computable in poly ( m ) \operatorname{poly}(m) poly ( m ) time, neighborhoods can be listed in poly ( m ) \operatorname{poly}(m) poly ( m ) time, and E m − 1 ( y ) \mathcal{E}_m^{-1}(y) E m − 1 ( y ) can be listed in poly ( m + ∣ y ∣ ) \operatorname{poly}(m+|y|) poly ( m + ∣ y ∣ ) time. Then, encoding takes poly ( m ) \operatorname{poly}(m) poly ( m ) time and decoding takes poly ( m + ∣ y ∣ ) \operatorname{poly}(m+|y|) poly ( m + ∣ y ∣ ) time.
Proof. The parameters b , r b,r b , r satisfy (3) . Given y ∈ E m ( x ) y\in\mathcal{E}_m(x) y ∈ E m ( x ) and the tag T = φ − 1 ( a ) ∥ φ − 1 ( λ ) ∥ η T=\varphi^{-1}(a)\mathbin\Vert\varphi^{-1}(\lambda)\mathbin\Vert\eta T = φ − 1 ( a ) ∥ φ − 1 ( λ ) ∥ η , the decoder scans z ∈ E m − 1 ( y ) z\in\mathcal{E}_m^{-1}(y) z ∈ E m − 1 ( y ) and checks whether π ( λ P z ( a ) ) = η \pi(\lambda P_z(a))=\eta π ( λ P z ( a )) = η . The true input x x x passes this check, whereas every other z ∈ E m − 1 ( y ) z\in\mathcal{E}_m^{-1}(y) z ∈ E m − 1 ( y ) is confusable with x x x (so z ∈ Γ ( x ) z\in\Gamma(x) z ∈ Γ ( x ) ) and therefore fails because λ ∈ Good 2 ( x , a ) \lambda\in\operatorname{Good}_2(x,a) λ ∈ Good 2 ( x , a ) ensures π ( λ P z ( a ) ) ≠ π ( λ P x ( a ) ) = η \pi(\lambda P_z(a))\ne\pi(\lambda P_x(a))=\eta π ( λ P z ( a )) = π ( λ P x ( a )) = η . Once x x x is identified, the decoder reconstructs Good 1 ( x ) \operatorname{Good}_1(x) Good 1 ( x ) and Good 2 ( x , a ) \operatorname{Good}_2(x,a) Good 2 ( x , a ) and recovers ( σ , τ ) (\sigma,\tau) ( σ , τ ) from the ranks of a a a and λ \lambda λ . The net cost and running times follow from Theorem 2.1 and § 2 . □
The generic decoder. Fix the parameters and tag code A : { 0 , 1 } h → { 0 , 1 } N A:\{0,1\}^{h}\to\{0,1\}^{N} A : { 0 , 1 } h → { 0 , 1 } N of Lemma 3.2 , let C \mathcal{C} C be the image of Enc \operatorname{Enc} Enc in (5) , and let K = 2 b − 1 K=2^{b-1} K = 2 b − 1 . The good- and bad-seed sets below are defined with respect to the same competitor sets Γ ( x ) = Γ ~ ( x ) \Gamma(x)=\widetilde{\Gamma}(x) Γ ( x ) = Γ ( x ) used by the encoder (implemented via the procedures of Appendix § 8 .§ 3 ).
Assume that, on every input, we can list E m − 1 ( y ) \mathcal{E}_m^{-1}(y) E m − 1 ( y ) and Γ ~ ( x ) \widetilde{\Gamma}(x) Γ ( x ) , test membership in A ( { 0 , 1 } h ) A(\{0,1\}^{h}) A ({ 0 , 1 } h ) , and invert A A A on its image. All these algorithms are assumed to terminate, and the lists may contain repetitions.
Procedure B.2 (Generic decoder). Given a string y y y , perform the following steps:
Identify a candidate. List E n − 1 ( y ) \mathcal{E}_n^{-1}(y) E n − 1 ( y ) . For each candidate z = x ′ ∥ u z=x'\mathbin\Vert u z = x ′ ∥ u with ∣ x ′ ∣ = m |x'|=m ∣ x ′ ∣ = m , check whether u ∈ A ( { 0 , 1 } h ) u\in A(\{0,1\}^{h}) u ∈ A ({ 0 , 1 } h ) . If so, write A − 1 ( u ) = α ∥ γ ∥ η A^{-1}(u)=\alpha\mathbin\Vert\gamma\mathbin\Vert\eta A − 1 ( u ) = α ∥ γ ∥ η with ∣ α ∣ = ∣ γ ∣ = b |\alpha|=|\gamma|=b ∣ α ∣ = ∣ γ ∣ = b and ∣ η ∣ = r |\eta|=r ∣ η ∣ = r , set a = φ ( α ) a=\varphi(\alpha) a = φ ( α ) and λ = φ ( γ ) \lambda=\varphi(\gamma) λ = φ ( γ ) , and stop at the first candidate z z z satisfying π ( λ P x ′ ( a ) ) = η \pi(\lambda P_{x'}(a))=\eta π ( λ P x ′ ( a )) = η . If no candidate passes, return failure . (To recover only the payload, output x ′ x' x ′ immediately after Step 1.)
Recover the first seed rank. Compute Bad 1 ( x ′ ) \operatorname{Bad}_1(x') Bad 1 ( x ′ ) . If a ∉ Good 1 ( x ′ ) a \notin\operatorname{Good}_1(x') a ∈ / Good 1 ( x ′ ) , or if the rank v v v of a a a in Good 1 ( x ′ ) \operatorname{Good}_1(x') Good 1 ( x ′ ) exceeds K K K , return failure .
Recover the second seed rank. Compute Bad 2 ( x ′ , a ) \operatorname{Bad}_2(x',a) Bad 2 ( x ′ , a ) . If λ ∉ Good 2 ( x ′ , a ) \lambda\notin\operatorname{Good}_2(x',a) λ ∈ / Good 2 ( x ′ , a ) , or if the rank w w w of λ \lambda λ in Good 2 ( x ′ , a ) \operatorname{Good}_2(x',a) Good 2 ( x ′ , a ) exceeds K K K , return failure . Otherwise, output ( x ′ , bin b − 1 ( v − 1 ) , bin b − 1 ( w − 1 ) ) (x',\operatorname{bin}_{b-1}(v-1),\operatorname{bin}_{b-1}(w-1)) ( x ′ , bin b − 1 ( v − 1 ) , bin b − 1 ( w − 1 )) .
Lemma B.3 (Correctness and termination of the generic decoder. ) Under the hypotheses of Lemma 3.2 and the algorithmic assumptions above, for any codeword c = Enc ( x , σ , τ ) c=\operatorname{Enc}(x,\sigma,\tau) c = Enc ( x , σ , τ ) and any valid channel output y ∈ E n ( c ) y\in\mathcal{E}_n(c) y ∈ E n ( c ) , the codeword c c c is the unique candidate passing Step 1 of Procedure B.2, and the procedure outputs ( x , σ , τ ) (x,\sigma,\tau) ( x , σ , τ ) . On an arbitrary input y ∈ { 0 , 1 } ∗ y\in\{0,1\}^* y ∈ { 0 , 1 } ∗ , Procedure B.2 always terminates, computes each bad-seed set at most once, and outputs either a message in { 0 , 1 } m + 2 b − 2 \{0,1\}^{m+2b-2} { 0 , 1 } m + 2 b − 2 or failure. With the parameter choices, tag code, and listing algorithms used in the proof of Theorem 3.3 , the procedure runs in poly ( n + ∣ y ∣ ) \operatorname{poly}(n+|y|) poly ( n + ∣ y ∣ ) time.
Proof. Correctness on valid channel outputs y ∈ E n ( c ) y\in\mathcal{E}_n(c) y ∈ E n ( c ) was shown in § 3.2 : c = x ∥ A ( T ) c=x\Vert A(T) c = x ∥ A ( T ) passes Step 1, any other passing candidate z = x ′ ∥ A ( T ′ ) z=x'\Vert A(T') z = x ′ ∥ A ( T ′ ) satisfies z ∼ n c z\sim_n c z ∼ n c and hence T ′ = T T'=T T ′ = T , and x ′ ≠ x x'\ne x x ′ = x would place x ′ ∈ Γ E ( x ) ⊆ Γ ~ ( x ) x'\in\Gamma_E(x)\subseteq\widetilde{\Gamma}(x) x ′ ∈ Γ E ( x ) ⊆ Γ ( x ) , contradicting λ ∈ Good 2 ( x , a ) \lambda\in\operatorname{Good}_2(x,a) λ ∈ Good 2 ( x , a ) . Since the seeds a , λ a,\lambda a , λ of c c c have ranks 1 + val ( σ ) ≤ K 1+\operatorname{val}(\sigma)\le K 1 + val ( σ ) ≤ K and 1 + val ( τ ) ≤ K 1+\operatorname{val}(\tau)\le K 1 + val ( τ ) ≤ K , Steps 2 and 3 output ( x , σ , τ ) (x,\sigma,\tau) ( x , σ , τ ) . On an arbitrary input y y y , Step 1 scans a finite list, Step 2 computes Bad 1 ( x ′ ) \operatorname{Bad}_1(x') Bad 1 ( x ′ ) only for the single candidate selected in Step 1, and Step 3 computes Bad 2 ( x ′ , a ) \operatorname{Bad}_2(x',a) Bad 2 ( x ′ , a ) only after Step 2 has verified that a ∈ Good 1 ( x ′ ) a\in\operatorname{Good}_1(x') a ∈ Good 1 ( x ′ ) (so that P x ′ ( a ) − P x ′ ′ ( a ) ≠ 0 P_{x'}(a)-P_{x''}(a)\ne0 P x ′ ( a ) − P x ′′ ( a ) = 0 for all x ′ ′ ∈ Γ ~ ( x ′ ) x''\in\widetilde{\Gamma}(x') x ′′ ∈ Γ ( x ′ ) ). Thus every step is well-defined and the procedure terminates. With the choices made in the proof of Theorem 3.3 , the listing, tag-code, and rank computations take poly ( n + ∣ y ∣ ) \operatorname{poly}(n+|y|) poly ( n + ∣ y ∣ ) time. For the t t t -edit and t t t -DL channels, inputs of length outside [ n − t , n + t ] [n-t,n+t] [ n − t , n + t ] are rejected immediately after reading at most n + t + 1 n+t+1 n + t + 1 bits, so the running time is poly ( n ) \operatorname{poly}(n) poly ( n ) on all inputs.
Testing codeword membership. To decide whether a given string u ∈ { 0 , 1 } n u\in\{0,1\}^n u ∈ { 0 , 1 } n belongs to the code C C C , run the full decoder and accept if and only if it returns a message μ \mu μ satisfying Enc ( μ ) = u \operatorname{Enc}(\mu)=u Enc ( μ ) = u . Indeed, if u ∈ C u\in C u ∈ C , then u ∈ E n ( u ) u\in\mathcal{E}_n(u) u ∈ E n ( u ) , so Lemma B.3 ensures that the decoder returns μ = Enc − 1 ( u ) \mu=\operatorname{Enc}^{-1}(u) μ = Enc − 1 ( u ) ; conversely, if Enc ( μ ) = u \operatorname{Enc}(\mu)=u Enc ( μ ) = u , then u ∈ C u\in C u ∈ C by definition. This re-encoding test is used in Appendix § 9 to invert the inner tag code.
Encoding and decoding
In this appendix, we give deterministic implementations of the tag construction from § 2 and the generic decoder from Appendix § 7 . Rather than scanning the entire field F Q \mathbb{F}_Q F Q to find good seeds, we compute the bad-seed sets directly by finding roots of difference polynomials in the first stage and enumerating scaled copies of ker π \ker\pi ker π in the second stage. In Section C.6, we also describe a decoding optimization for channels with only insertions, deletions, and substitutions, which recovers the short suffix before enumerating payload candidates.
Representation and precomputation
All algorithms are deterministic, and costs are measured in bit operations on a RAM. We fix a monic irreducible polynomial f b ∈ F 2 [ U ] f_b\in\mathbb{F}_2[U] f b ∈ F 2 [ U ] of degree b b b and represent F Q = F 2 [ U ] / ( f b ) \mathbb{F}_Q=\mathbb{F}_2[U]/(f_b) F Q = F 2 [ U ] / ( f b ) (where Q = 2 b Q=2^b Q = 2 b ) via the bijection φ ( u 1 ⋯ u b ) = ∑ i = 1 b u i U i − 1 \varphi(u_1\cdots u_b)=\sum_{i=1}^{b}u_iU^{i-1} φ ( u 1 ⋯ u b ) = ∑ i = 1 b u i U i − 1 , ordered by ι ( a ) = val ( φ − 1 ( a ) ) \iota(a)=\operatorname{val}(\varphi^{-1}(a)) ι ( a ) = val ( φ − 1 ( a )) . Addition and comparison in F Q \mathbb{F}_Q F Q take O ( b ) O(b) O ( b ) bit operations, while schoolbook multiplication and inversion take O ( b 2 ) O(b^2) O ( b 2 ) bit operations. The polynomial f b f_b f b can be found deterministically in poly ( b ) \operatorname{poly}(b) poly ( b ) time [42 ] , which is polylog ( n ) \operatorname{polylog}(n) polylog ( n ) time for our parameters.
For the tag code A : { 0 , 1 } h → { 0 , 1 } N A:\{0,1\}^{h}\to\{0,1\}^{N} A : { 0 , 1 } h → { 0 , 1 } N , let τ A \tau_A τ A denote the time required to compute A ( T ) A(T) A ( T ) , or to test membership in A ( { 0 , 1 } h ) A(\{0,1\}^{h}) A ({ 0 , 1 } h ) and compute A − 1 ( u ) A^{-1}(u) A − 1 ( u ) . We have τ A = O t ( log n ) \tau_A=O_t(\log n) τ A = O t ( log n ) for the greedy table-lookup construction of § 3.3 and τ A = polylog ( n ) \tau_A=\operatorname{polylog}(n) τ A = polylog ( n ) for the bootstrapped construction of Appendix § 9 . Enumeration procedures may produce repeated entries (which are included in our list-size bounds), whereas bad-seed lists are sorted and deduplicated before selection or ranking.
Finding roots of difference polynomials
To compute Bad 1 ( x ) \operatorname{Bad}_1(x) Bad 1 ( x ) , we need to find all roots in F Q \mathbb{F}_Q F Q of nonzero difference polynomials P x − P x ′ P_x-P_{x'} P x − P x ′ . Since F Q \mathbb{F}_Q F Q has characteristic two, we can find these roots deterministically using Berlekamp’s trace method [2 ] . Let Tr ( z ) = ∑ j = 0 b − 1 z 2 j \operatorname{Tr}(z)=\sum_{j=0}^{b-1}z^{2^j} Tr ( z ) = ∑ j = 0 b − 1 z 2 j be the absolute trace from F Q \mathbb{F}_Q F Q to F 2 \mathbb{F}_2 F 2 , and let β i = U i − 1 \beta_i=U^{i-1} β i = U i − 1 for i ∈ [ b ] i\in[b] i ∈ [ b ] be the polynomial basis of F Q \mathbb{F}_Q F Q over F 2 \mathbb{F}_2 F 2 . Note that Tr \operatorname{Tr} Tr is F 2 \mathbb{F}_2 F 2 -linear and not identically zero (since it has degree 2 b − 1 < Q 2^{b-1}<Q 2 b − 1 < Q ).
Procedure C.1 (Finding roots). Given a nonzero polynomial R ∈ F Q [ Z ] R\in\mathbb{F}_Q[Z] R ∈ F Q [ Z ] of degree d d d :
If d = 0 d=0 d = 0 , return ∅ \varnothing ∅ .
Compute S = Z Q m o d R S=Z^Q\bmod R S = Z Q mod R by b b b successive squarings modulo R R R , and let G = gcd ( R , S − Z ) G=\gcd(R,S-Z) G = g cd( R , S − Z ) (made monic). If deg G = 0 \deg G=0 deg G = 0 , return ∅ \varnothing ∅ .
Initialize F = { G } \mathcal{F}=\{G\} F = { G } . For i = 1 , … , b i=1,\ldots,b i = 1 , … , b , compute H i = ∑ j = 0 b − 1 ( β i Z ) 2 j m o d G H_i=\sum_{j=0}^{b-1}(\beta_iZ)^{2^j}\bmod G H i = ∑ j = 0 b − 1 ( β i Z ) 2 j mod G , and replace each F ∈ F F\in\mathcal{F} F ∈ F with deg F > 1 \deg F>1 deg F > 1 by the nonconstant polynomials among gcd ( F , H i ) \gcd(F,H_i) g cd( F , H i ) and gcd ( F , H i + 1 ) \gcd(F,H_i+1) g cd( F , H i + 1 ) .
Return { ρ ∈ F Q : Z − ρ ∈ F } \{\rho\in\mathbb{F}_Q:Z-\rho\in F\} { ρ ∈ F Q : Z − ρ ∈ F } .
Lemma C.2 (Deterministic root finding). Procedure C.1 returns the set of all roots of R R R in F Q \mathbb{F}_Q F Q using O ( 1 + b 2 d 2 ) O(1+b^2d^2) O ( 1 + b 2 d 2 ) operations in F Q \mathbb{F}_Q F Q , or O ( b 2 + b 4 d 2 ) O(b^2+b^4d^2) O ( b 2 + b 4 d 2 ) bit operations.
Proof. The case d = 0 d=0 d = 0 is trivial. For d ≥ 1 d\ge1 d ≥ 1 , since Z Q − Z = ∏ ρ ∈ F Q ( Z − ρ ) Z^Q-Z=\prod_{\rho\in\mathbb{F}_Q}(Z-\rho) Z Q − Z = ∏ ρ ∈ F Q ( Z − ρ ) is square-free, G = gcd ( R , Z Q − Z ) = gcd ( R , S − Z ) G=\gcd(R,Z^Q-Z)=\gcd(R,S-Z) G = g cd( R , Z Q − Z ) = g cd( R , S − Z ) is the product of Z − ρ Z-\rho Z − ρ over all distinct roots ρ ∈ F Q \rho\in\mathbb{F}_Q ρ ∈ F Q of R R R . For any root ρ \rho ρ of G G G , we have H i ( ρ ) = Tr ( β i ρ ) ∈ { 0 , 1 } H_i(\rho)=\operatorname{Tr}(\beta_i\rho)\in\{0,1\} H i ( ρ ) = Tr ( β i ρ ) ∈ { 0 , 1 } , so taking gcd ( F , H i ) \gcd(F,H_i) g cd( F , H i ) and gcd ( F , H i + 1 ) \gcd(F,H_i+1) g cd( F , H i + 1 ) splits each factor F ∈ F F\in\mathcal{F} F ∈ F according to the value of Tr ( β i ρ ) \operatorname{Tr}(\beta_i\rho) Tr ( β i ρ ) on its roots.
If two distinct roots ρ ≠ ρ ′ \rho\ne\rho' ρ = ρ ′ remained in the same factor after all b b b iterations, we would have Tr ( β i ( ρ − ρ ′ ) ) = 0 \operatorname{Tr}(\beta_i(\rho-\rho'))=0 Tr ( β i ( ρ − ρ ′ )) = 0 for all i ∈ [ b ] i\in[b] i ∈ [ b ] , and hence Tr ( z ( ρ − ρ ′ ) ) = 0 \operatorname{Tr}(z(\rho-\rho'))=0 Tr ( z ( ρ − ρ ′ )) = 0 for all z ∈ F Q z\in\mathbb{F}_Q z ∈ F Q by F 2 \mathbb{F}_2 F 2 -linearity. Since multiplication by ρ − ρ ′ ≠ 0 \rho-\rho'\ne0 ρ − ρ ′ = 0 is a bijection on F Q \mathbb{F}_Q F Q , this would imply Tr ≡ 0 \operatorname{Tr}\equiv0 Tr ≡ 0 , a contradiction. Thus F \mathcal{F} F consists of linear factors Z − ρ Z-\rho Z − ρ after Step 3.
For the running time, Step 2 takes O ( b d 2 ) O(bd^2) O ( b d 2 ) field operations. Letting e = deg G ≤ d e=\deg G\le d e = deg G ≤ d , computing H i H_i H i in iteration i i i takes O ( b e 2 ) O(be^2) O ( b e 2 ) field operations. For each F ∈ F F\in\mathcal{F} F ∈ F , reducing H i H_i H i modulo F F F takes O ( e deg F ) O(e\deg F) O ( e deg F ) field operations, after which the two gcd computations take O ( ( deg F ) 2 ) O((\deg F)^2) O (( deg F ) 2 ) field operations. Their total cost is therefore O ( ∑ F ∈ F ( e deg F + ( deg F ) 2 ) ) = O ( e 2 ) O\left(\sum_{F\in\mathcal{F}}(e\deg F+(\deg F)^2)\right)=O(e^2) O ( ∑ F ∈ F ( e deg F + ( deg F ) 2 ) ) = O ( e 2 ) , since ∑ F ∈ F deg F = e \sum_{F\in\mathcal{F}}\deg F=e ∑ F ∈ F deg F = e . Summing over b b b iterations gives O ( b d 2 + b 2 e 2 ) = O ( b 2 d 2 ) O(bd^2+b^2e^2)=O(b^2d^2) O ( b d 2 + b 2 e 2 ) = O ( b 2 d 2 ) field operations, or O ( b 4 d 2 ) O(b^4d^2) O ( b 4 d 2 ) bit operations.
Computing seeds and ranks
Both selecting the v v v -th good seed at the encoder and finding the rank of a good seed at the decoder can be done directly from a sorted list of bad seeds.
Procedure C.3 (Select and Rank). Given a list B = ( β 1 , … , β s ) \mathcal{B}=(\beta_1,\ldots,\beta_s) B = ( β 1 , … , β s ) of distinct elements of F Q \mathbb{F}_Q F Q sorted by ι \iota ι (with s = 0 s=0 s = 0 allowed), let G = F Q ∖ { β 1 , … , β s } \mathcal{G}=\mathbb{F}_Q\setminus\{\beta_1,\ldots,\beta_s\} G = F Q ∖ { β 1 , … , β s } .
Select ( v ) (v) ( v ) (for 1 ≤ v ≤ ∣ G ∣ 1\le v\le|\mathcal{G}| 1 ≤ v ≤ ∣ G ∣ ): Set c = v − 1 c=v-1 c = v − 1 . For i = 1 , … , s i=1,\ldots,s i = 1 , … , s , if ι ( β i ) ≤ c \iota(\beta_i)\le c ι ( β i ) ≤ c then increment c ← c + 1 c\leftarrow c+1 c ← c + 1 , else stop the loop. Return ι − 1 ( c ) \iota^{-1}(c) ι − 1 ( c ) .
Rank ( a ) (a) ( a ) : Use binary search to test whether a ∈ B a \in\mathcal{B} a ∈ B . If so, return bad ; otherwise, return ι ( a ) + 1 − ∣ { i : ι ( β i ) < ι ( a ) } ∣ \iota(a)+1-\left|\{i:\iota(\beta_i)<\iota(a)\}\right| ι ( a ) + 1 − ∣ { i : ι ( β i ) < ι ( a )} ∣ using the count from the binary search.
Lemma C.4 (Selection and ranking). Select ( v ) (v) ( v ) returns the v v v -th smallest element of G \mathcal{G} G under ι \iota ι , and Rank ( a ) (a) ( a ) returns the rank of a a a in G \mathcal{G} G (or bad if a ∉ G a\notin\mathcal{G} a ∈ / G ), using O ( s + 1 ) O(s+1) O ( s + 1 ) and O ( log ( s + 2 ) ) O(\log(s+2)) O ( log ( s + 2 )) comparisons, respectively.
Proof. If Select ( v ) (v) ( v ) processes j j j elements of B \mathcal{B} B before stopping, it terminates with c = v − 1 + j ≤ ∣ G ∣ − 1 + s = Q − 1 c=v-1+j\leq|\mathcal{G}|-1+s=Q-1 c = v − 1 + j ≤ ∣ G ∣ − 1 + s = Q − 1 . Exactly j j j bad elements have index at most c c c (and all have index strictly less than c c c ), so ι − 1 ( c ) ∈ G \iota^{-1}(c)\in\mathcal{G} ι − 1 ( c ) ∈ G and there are ( c + 1 ) − j = v (c+1)-j=v ( c + 1 ) − j = v elements of G \mathcal{G} G with index at most c c c . Similarly, for a ∈ G a\in\mathcal{G} a ∈ G , Rank ( a ) (a) ( a ) counts all elements with index at most ι ( a ) \iota(a) ι ( a ) and subtracts the bad ones. □ \square □
Recall that for a competitor set Γ ( x ) \Gamma(x) Γ ( x ) , the two bad-seed sets are
Bad 1 ( x ) = ⋃ x ′ ∈ Γ ( x ) { ρ ∈ F Q : P x ( ρ ) = P x ′ ( ρ ) } and Bad 2 ( x , a ) = ⋃ x ′ ∈ Γ ( x ) δ x ′ − 1 ker π , \operatorname{Bad}_{1}(x)=\bigcup_{x'\in\Gamma(x)}\{\rho\in\mathbb{F}_{Q}:P_x(\rho)=P_{x'}(\rho)\}
\qquad\text{and}\qquad
\operatorname{Bad}_{2}(x,a)=\bigcup_{x'\in\Gamma(x)}\delta_{x'}^{-1}\ker\pi, Bad 1 ( x ) = x ′ ∈ Γ ( x ) ⋃ { ρ ∈ F Q : P x ( ρ ) = P x ′ ( ρ )} and Bad 2 ( x , a ) = x ′ ∈ Γ ( x ) ⋃ δ x ′ − 1 ker π ,
where δ x ′ = P x ( a ) − P x ′ ( a ) ≠ 0 \delta_{x'}=P_x(a)-P_{x'}(a)\ne0 δ x ′ = P x ( a ) − P x ′ ( a ) = 0 for a ∈ Good 1 ( x ) a\in\operatorname{Good}_{1}(x) a ∈ Good 1 ( x ) , and ker π = φ ( { 0 } r × { 0 , 1 } b − r ) = span F 2 { U r , … , U b − 1 } \ker\pi=\varphi(\{0\}^{r}\times\{0,1\}^{b-r})=\operatorname{span}_{\mathbb{F}_{2}}\{U^{r},\ldots,U^{b-1}\} ker π = φ ({ 0 } r × { 0 , 1 } b − r ) = span F 2 { U r , … , U b − 1 } .
Lemma C.5 (Computing seeds and ranks). Let b , r b,r b , r satisfy (3) , let k = ⌈ m / b ⌉ k=\lceil m/b\rceil k = ⌈ m / b ⌉ , and let Λ \Lambda Λ be a list of L ′ L' L ′ entries containing the exact elements of Γ ( x ) \Gamma(x) Γ ( x ) (possibly with repetitions). Then:
(a) The sorted, deduplicated list Bad 1 ( x ) \operatorname{Bad}_{1}(x) Bad 1 ( x ) can be computed using O ( L ′ ( k + m 2 ) ) O(L'(k+m^{2})) O ( L ′ ( k + m 2 )) field operations and sorting at most s 1 ≤ L ′ ( k − 1 ) s_{1}\leq L'(k-1) s 1 ≤ L ′ ( k − 1 ) elements of F Q \mathbb{F}_{Q} F Q .
(b) Given a ∈ Good 1 ( x ) a\in\operatorname{Good}_{1}(x) a ∈ Good 1 ( x ) , both P x ( a ) P_x(a) P x ( a ) and the sorted, deduplicated list Bad 2 ( x , a ) \operatorname{Bad}_{2}(x,a) Bad 2 ( x , a ) can be computed using O ( k + L ′ ( k + 2 b − r ) ) O(k+L'(k+2^{b-r})) O ( k + L ′ ( k + 2 b − r )) field operations and sorting at most s 2 ≤ L ′ 2 b − r s_{2}\leq L'2^{b-r} s 2 ≤ L ′ 2 b − r elements of F Q \mathbb{F}_{Q} F Q .
(c) Once these lists are computed, selecting both seeds takes O ( s 1 + s 2 + 2 ) O(s_{1}+s_{2}+2) O ( s 1 + s 2 + 2 ) comparisons, and recovering their ranks takes O ( log ( s 1 + 2 ) + log ( s 2 + 2 ) ) O(\log(s_{1}+2)+\log(s_{2}+2)) O ( log ( s 1 + 2 ) + log ( s 2 + 2 )) comparisons.
In total, writing s = s 1 + s 2 s=s_{1}+s_{2} s = s 1 + s 2 , computing Tag ( x , σ , τ ) \operatorname{Tag}(x,\sigma,\tau) Tag ( x , σ , τ ) or recovering ( σ , τ ) (\sigma,\tau) ( σ , τ ) from x x x and its tag takes
O ( m + b + ( L ′ + 1 ) ( m 2 + 2 b − r ) b 2 + ( s + 1 ) b log ( s + 2 ) ) O\left(m+b+(L'+1)(m^{2}+2^{b-r})b^{2}+(s+1)b\log(s+2)\right) O ( m + b + ( L ′ + 1 ) ( m 2 + 2 b − r ) b 2 + ( s + 1 ) b log ( s + 2 ) )
bit operations. For the parameters of § 4 , this is O t ( n 2 t + 2 log 2 n ) O_t(n^{2t+2}\log^{2}n) O t ( n 2 t + 2 log 2 n ) bit operations.
Proof. Padding x x x and reading the coefficients of P x P_x P x takes O ( k b ) = O ( m + b ) O(kb)=O(m+b) O ( k b ) = O ( m + b ) bit operations. For each x ′ ∈ Λ x'\in\Lambda x ′ ∈ Λ , forming R = P x − P x ′ R=P_x-P_{x'} R = P x − P x ′ takes O ( k ) O(k) O ( k ) field operations, and since deg R ≤ k − 1 \deg R\leq k-1 deg R ≤ k − 1 and b ( k − 1 ) < m b(k-1)<m b ( k − 1 ) < m , Procedure C.1 finds the at most k − 1 k-1 k − 1 roots of R R R in O ( 1 + b 2 ( k − 1 ) 2 ) = O ( 1 + m 2 ) O(1+b^{2}(k-1)^{2})=O(1+m^{2}) O ( 1 + b 2 ( k − 1 ) 2 ) = O ( 1 + m 2 ) field operations. Sorting and deduplicating the s 1 ≤ L ′ ( k − 1 ) s_{1}\leq L'(k-1) s 1 ≤ L ′ ( k − 1 ) roots gives Bad 1 ( x ) \operatorname{Bad}_{1}(x) Bad 1 ( x ) .
For (b), evaluating P x ( a ) P_x(a) P x ( a ) and each δ x ′ = P x ( a ) − P x ′ ( a ) \delta_{x'}=P_x(a)-P_{x'}(a) δ x ′ = P x ( a ) − P x ′ ( a ) by Horner’s rule takes O ( ( L ′ + 1 ) k ) O((L'+1)k) O (( L ′ + 1 ) k ) field operations. Since a ∈ Good 1 ( x ) a\in\operatorname{Good}_{1}(x) a ∈ Good 1 ( x ) , each δ x ′ \delta_{x'} δ x ′ is nonzero; after computing δ x ′ − 1 \delta_{x'}^{-1} δ x ′ − 1 and the basis δ x ′ − 1 U r , … , δ x ′ − 1 U b − 1 \delta_{x'}^{-1}U^{r},\ldots,\delta_{x'}^{-1}U^{b-1} δ x ′ − 1 U r , … , δ x ′ − 1 U b − 1 , we can list the 2 b − r 2^{b-r} 2 b − r elements of δ x ′ − 1 ker π \delta_{x'}^{-1}\ker\pi δ x ′ − 1 ker π in Gray-code order using one field addition per element. Sorting and deduplicating the resulting s 2 ≤ L ′ 2 b − r s_{2}\leq L'2^{b-r} s 2 ≤ L ′ 2 b − r elements gives Bad 2 ( x , a ) \operatorname{Bad}_{2}(x,a) Bad 2 ( x , a ) . Part (c) follows from Lemma C.4.
Finally, multiplying field operations by O ( b 2 ) O(b^{2}) O ( b 2 ) and comparisons by O ( b ) O(b) O ( b ) gives the bit-operation bound. For the parameters of § 4 , we have L ′ = O t ( n 2 t ) L'=O_t(n^{2t}) L ′ = O t ( n 2 t ) , b = O t ( log n ) b=O_t(\log n) b = O t ( log n ) , m < n m<n m < n , and 2 b − r ≤ 2 n 2^{b-r}\leq2n 2 b − r ≤ 2 n , so s = O t ( n 2 t + 1 ) s=O_t(n^{2t+1}) s = O t ( n 2 t + 1 ) , the field-arithmetic cost is O t ( n 2 t + 2 log 2 n ) O_t(n^{2t+2}\log^{2}n) O t ( n 2 t + 2 log 2 n ) , and the sorting cost is O t ( n 2 t + 1 log 2 n ) O_t(n^{2t+1}\log^{2}n) O t ( n 2 t + 1 log 2 n ) . □ \square □
Enumerating competitors and preimages
We now record the enumeration procedures underlying the list-size and running-time bounds in § 4.2 . The payload competitors, suffix neighborhoods, and channel preimages are all obtained by enumerating DL balls and filtering by length (with repetitions included in all bounds below).
Lemma C.6 (Enumerating DL balls). For every u ∈ { 0 , 1 } ℓ u \in\{0,1\}^{\ell} u ∈ { 0 , 1 } ℓ and integer q ≥ 0 q \ge0 q ≥ 0 , the ball B q ( u ) B_q(u) B q ( u ) can be listed deterministically (possibly with repetitions) in O ( M ( ℓ , q ) ( ℓ + q + 1 ) ) O(M(\ell,q)(\ell+q+1)) O ( M ( ℓ , q ) ( ℓ + q + 1 )) bit operations with at most
M ( ℓ , q ) : = ( q + 1 ) ( 5 ( ℓ + q ) + 2 ) q M(\ell,q) := (q+1)(5(\ell+q)+2)^q M ( ℓ , q ) := ( q + 1 ) ( 5 ( ℓ + q ) + 2 ) q entries.
Proof. We traverse the tree of depth q q q rooted at u u u , where the children of each node are obtained by applying one DL operation to the string at that node, and output the string at every visited node. Every string in B q ( u ) B_q(u) B q ( u ) has length at most ℓ + q \ell+q ℓ + q , and a string of length a a a admits 2 ( a + 1 ) 2(a+1) 2 ( a + 1 ) insertions, a a a deletions, a a a substitutions, and at most a a a adjacent transpositions, for a total of at most 5 a + 2 ≤ 5 ( ℓ + q ) + 2 5a+2 \le5(\ell+q)+2 5 a + 2 ≤ 5 ( ℓ + q ) + 2 operations. Thus the tree has at most ∑ j = 0 q ( 5 ( ℓ + q ) + 2 ) j ≤ M ( ℓ , q ) \sum_{j=0}^{q}(5(\ell+q)+2)^j \le M(\ell,q) ∑ j = 0 q ( 5 ( ℓ + q ) + 2 ) j ≤ M ( ℓ , q ) nodes, and generating each child from its parent takes O ( ℓ + q + 1 ) O(\ell+q+1) O ( ℓ + q + 1 ) bit operations.
For fixed t ≥ 1 t \ge1 t ≥ 1 and n = m + N ≥ 2 t + 1 n=m+N \ge2t+1 n = m + N ≥ 2 t + 1 , recall that D t D L = ( 2 t + 1 ) 10 2 t D_t^{\mathrm{DL}}=(2t+1)10^{2t} D t DL = ( 2 t + 1 ) 1 0 2 t . Applying Lemma C.6 gives the three required lists:
Payload competitors: By Corollary 4.2, Γ D L ( x ) = ( B 2 t ( x ) ∩ { 0 , 1 } m ) ∖ { x } \Gamma_{\mathrm{DL}}(x)=(B_{2t}(x)\cap\{0,1\}^{m})\setminus\{x\} Γ DL ( x ) = ( B 2 t ( x ) ∩ { 0 , 1 } m ) ∖ { x } . Listing B 2 t ( x ) B_{2t}(x) B 2 t ( x ) and keeping strings of length m m m different from x x x gives at most M ( m , 2 t ) ≤ D t D L n 2 t M(m,2t)\le D_t^{\mathrm{DL}}n^{2t} M ( m , 2 t ) ≤ D t DL n 2 t entries in O t ( n 2 t + 1 ) O_t(n^{2t+1}) O t ( n 2 t + 1 ) bit operations (since 5 ( m + 2 t ) + 2 ≤ 10 n 5(m+2t)+2\le10n 5 ( m + 2 t ) + 2 ≤ 10 n ).
Suffix neighborhoods: For s ∈ { 0 , 1 } N s\in\{0,1\}^{N} s ∈ { 0 , 1 } N , listing B 2 t ( s ) B_{2t}(s) B 2 t ( s ) and keeping strings of length N N N gives the R N \mathcal{R}_{N} R N -neighborhood B 2 t ( s ) ∩ { 0 , 1 } N B_{2t}(s)\cap\{0,1\}^{N} B 2 t ( s ) ∩ { 0 , 1 } N in O t ( N 2 t + 1 ) O_t(N^{2t+1}) O t ( N 2 t + 1 ) bit operations, with size bounded by D N ≤ D t D L N 2 t D_N\le D_t^{\mathrm{DL}}N^{2t} D N ≤ D t DL N 2 t .
Decoder preimages: For any received word y y y with ∣ y ∣ ∈ [ n − t , n + t ] |y|\in[n-t,n+t] ∣ y ∣ ∈ [ n − t , n + t ] , listing B t ( y ) B_t(y) B t ( y ) and keeping strings of length n n n gives E n − 1 ( y ) = B t ( y ) ∩ { 0 , 1 } n \mathcal{E}_n^{-1}(y)=B_t(y)\cap\{0,1\}^{n} E n − 1 ( y ) = B t ( y ) ∩ { 0 , 1 } n with O t ( n t ) O_t(n^t) O t ( n t ) entries in O t ( n t + 1 ) O_t(n^{t+1}) O t ( n t + 1 ) bit operations (while inputs with ∣ y ∣ ∉ [ n − t , n + t ] |y|\notin[n-t,n+t] ∣ y ∣ ∈ / [ n − t , n + t ] have E n − 1 ( y ) = ∅ \mathcal{E}_n^{-1}(y)=\varnothing E n − 1 ( y ) = ∅ ).
Omitting adjacent transpositions from Lemma C.6 gives the analogous enumeration for ordinary edit balls E q ( u ) E_q(u) E q ( u ) , which we use in Appendix § 8 .6.
Encoding and decoding complexity for DL errors
Combining Lemma C.5 with the competitor and preimage enumerations of § 4.2 yields the complexity bounds stated in Theorem 4.3 .
Theorem C.7 (Encoding and decoding complexity). Fix t ≥ 1 t\ge1 t ≥ 1 and the parameters of § 4 . After precomputation, the encoder (5) and the generic decoder (Procedure B.2) run in the following numbers of bit operations:
(a) encoding: O t ( n 2 t + 2 log 2 n ) + O ( τ A ) O_t(n^{2t+2}\log^2 n)+O(\tau_A) O t ( n 2 t + 2 log 2 n ) + O ( τ A ) ;
(b) payload recovery: O t ( n t + 1 log n ) + O t ( n t ) τ A O_t(n^{t+1}\log n)+O_t(n^t)\tau_A O t ( n t + 1 log n ) + O t ( n t ) τ A ;
(c) full-message recovery: O t ( n 2 t + 2 log 2 n ) + O t ( n t ) τ A O_t(n^{2t+2}\log^2 n)+O_t(n^t)\tau_A O t ( n 2 t + 2 log 2 n ) + O t ( n t ) τ A .
Proof. Encoding lists Γ D L ( x ) \Gamma_{\mathrm{DL}}(x) Γ DL ( x ) in O t ( n 2 t + 1 ) O_t(n^{2t+1}) O t ( n 2 t + 1 ) bit operations, computes the tag in O t ( n 2 t + 2 log 2 n ) O_t(n^{2t+2}\log^2 n) O t ( n 2 t + 2 log 2 n ) bit operations by Lemma C.5 , and applies A A A in time τ A \tau_A τ A . For decoding, after rejecting inputs with ∣ y ∣ ∉ [ n − t , n + t ] |y|\notin[n-t,n+t] ∣ y ∣ ∈ / [ n − t , n + t ] , Step 1 of Procedure B.2 lists E n − 1 ( y ) = B t ( y ) ∩ { 0 , 1 } n \mathcal{E}_n^{-1}(y)=B_t(y)\cap\{0,1\}^{n} E n − 1 ( y ) = B t ( y ) ∩ { 0 , 1 } n (O t ( n t ) O_t(n^t) O t ( n t ) entries in O t ( n t + 1 ) O_t(n^{t+1}) O t ( n t + 1 ) time) and tests each candidate using time τ A \tau_A τ A for A − 1 A^{-1} A − 1 and O ( k b 2 ) = O t ( n log n ) O(kb^2)=O_t(n\log n) O ( k b 2 ) = O t ( n log n ) bit operations for Horner's rule, giving (b). Once a candidate passes Step 1, Steps 2 and 3 compute B a d 1 \mathrm{Bad}_1 Bad 1 and B a d 2 \mathrm{Bad}_2 Bad 2 at most once, which adds O t ( n 2 t + 2 log 2 n ) O_t(n^{2t+2}\log^2 n) O t ( n 2 t + 2 log 2 n ) bit operations by Lemma C.5 .
Reducing tag-code queries for edits
When the channel introduces only insertions, deletions, and substitutions (i.e., d L ( c , y ) ≤ t d_L(c,y) \le t d L ( c , y ) ≤ t ), we can decode the exact same DL code of § 4 while reducing the number of tag-code queries from O t ( n t ) O_t(n^t) O t ( n t ) to O t ( log t n ) O_t(\log^t n) O t ( log t n ) . The key observation is that under t t t ordinary edits, the boundary between x x x and s s s shifts by at most t t t positions in y y y , allowing us to recover candidate tags from the suffix of y y y before enumerating payload candidates.
Lemma C.8 (Locating the boundary under edits). If c = x ∥ s c=x\mathbin\Vert s c = x ∥ s with ∣ x ∣ = m |x|=m ∣ x ∣ = m and d L ( c , y ) ≤ t d_L(c,y) \le t d L ( c , y ) ≤ t , then there is an index j ∈ [ max { 0 , m − t } , min { m + t , ∣ y ∣ } ] j \in[\max\{0,m-t\},\min\{m+t,|y|\}] j ∈ [ max { 0 , m − t } , min { m + t , ∣ y ∣ }] such that d L ( x , y [ 1 , j ] ) ≤ t d_L(x,y_{[1,j]}) \le t d L ( x , y [ 1 , j ] ) ≤ t and d L ( s , y [ j + 1 , ∣ y ∣ ] ) ≤ t d_L(s,y_{[j+1,|y|]}) \le t d L ( s , y [ j + 1 , ∣ y ∣ ] ) ≤ t .
Proof. Fix an optimal edit alignment between c = x ∥ s c=x\mathbin\Vert s c = x ∥ s and y y y of cost at most t t t , and cut it immediately after the column containing the last bit of x x x . If j j j bits of y y y lie to the left of the cut and the two halves of the alignment have costs t 1 t_1 t 1 and t 2 t_2 t 2 , then t 1 + t 2 ≤ t t_1+t_2 \le t t 1 + t 2 ≤ t , d L ( x , y [ 1 , j ] ) ≤ t 1 d_L(x,y_{[1,j]}) \le t_1 d L ( x , y [ 1 , j ] ) ≤ t 1 , d L ( s , y [ j + 1 , ∣ y ∣ ] ) ≤ t 2 d_L(s,y_{[j+1,|y|]}) \le t_2 d L ( s , y [ j + 1 , ∣ y ∣ ] ) ≤ t 2 , and ∣ j − m ∣ ≤ t 1 ≤ t |j-m| \le t_1 \le t ∣ j − m ∣ ≤ t 1 ≤ t .
Below, E t ( u ) = { v : d L ( u , v ) ≤ t } \mathcal{E}_t(u)=\{v:d_L(u,v)\le t\} E t ( u ) = { v : d L ( u , v ) ≤ t } denotes the edit ball of radius t t t , which can be listed with O t ( ( ∣ u ∣ + 1 ) t ) O_t((|u|+1)^t) O t (( ∣ u ∣ + 1 ) t ) entries in O t ( ( ∣ u ∣ + 1 ) t + 1 ) O_t((|u|+1)^{t+1}) O t (( ∣ u ∣ + 1 ) t + 1 ) time by omitting transpositions from the enumeration of § 4.2 .
Procedure C.9 (Decoder for ordinary edits). Given a string y y y with ∣ y ∣ ∈ [ n − t , n + t ] |y| \in[n-t,n+t] ∣ y ∣ ∈ [ n − t , n + t ] :
Candidate tags. Initialize T = ∅ \mathcal{T}=\emptyset T = ∅ . For each j ∈ [ max { 0 , m − t } , min { m + t , ∣ y ∣ } ] j \in[\max\{0,m-t\},\min\{m+t,|y|\}] j ∈ [ max { 0 , m − t } , min { m + t , ∣ y ∣ }] , scan u ∈ E t ( y [ j + 1 , ∣ y ∣ ] ) ∩ { 0 , 1 } N u \in\mathcal{E}_t(y_{[j+1,|y|]})\cap\{0,1\}^{N} u ∈ E t ( y [ j + 1 , ∣ y ∣ ] ) ∩ { 0 , 1 } N ; at the first u ∈ A ( { 0 , 1 } h ) u \in A(\{0,1\}^{h}) u ∈ A ({ 0 , 1 } h ) , add ( j , A − 1 ( u ) , u ) (j,A^{-1}(u),u) ( j , A − 1 ( u ) , u ) to T \mathcal{T} T and move to the next j j j .
Candidate payloads. For each ( j , T , u ) ∈ T (j,T,u)\in\mathcal{T} ( j , T , u ) ∈ T , write T = φ − 1 ( a ) ∥ φ − 1 ( λ ) ∥ η T=\varphi^{-1}(a)\mathbin\Vert\varphi^{-1}(\lambda)\mathbin\Vert\eta T = φ − 1 ( a ) ∥ φ − 1 ( λ ) ∥ η and scan x ′ ∈ E t ( y [ 1 , j ] ) ∩ { 0 , 1 } m x'\in\mathcal{E}_t(y_{[1,j]})\cap\{0,1\}^{m} x ′ ∈ E t ( y [ 1 , j ] ) ∩ { 0 , 1 } m . If a candidate satisfies both π ( λ P x ′ ( a ) ) = η \pi(\lambda P_{x'}(a))=\eta π ( λ P x ′ ( a )) = η and d L ( x ′ ∥ u , y ) ≤ t d_L(x'\mathbin\Vert u,y)\le t d L ( x ′ ∥ u , y ) ≤ t , retain ( x ′ , a , λ ) (x',a,\lambda) ( x ′ , a , λ ) and proceed to Step 3. (To recover only the payload, output x ′ x' x ′ instead.) Return failure only after all triples in T \mathcal{T} T and their associated payload candidates have been exhausted.
Seed ranks. Run Steps 2 and 3 of Procedure B.2 on ( x ′ , a , λ ) (x',a,\lambda) ( x ′ , a , λ ) using Γ D L ( x ′ ) \Gamma_{\mathrm{DL}}(x') Γ DL ( x ′ ) .
Lemma C.10 (Correctness and cost of the edit decoder). For any codeword c = Enc ( x , σ , τ ) c=\operatorname{Enc}(x,\sigma,\tau) c = Enc ( x , σ , τ ) of the DL code and any y y y with d L ( c , y ) ≤ t d_L(c,y)\le t d L ( c , y ) ≤ t , Procedure C.9 outputs ( x , σ , τ ) (x,\sigma,\tau) ( x , σ , τ ) using O t ( log t n ) O_t(\log^t n) O t ( log t n ) tag-code queries, O t ( n t + 1 log n ) + O t ( log t n ) τ A O_t(n^{t+1}\log n)+O_t(\log^t n)\tau_A O t ( n t + 1 log n ) + O t ( log t n ) τ A bit operations for payload recovery, and O t ( n 2 t + 2 log 2 n ) + O t ( log t n ) τ A O_t(n^{2t+2}\log^2 n)+O_t(\log^t n)\tau_A O t ( n 2 t + 2 log 2 n ) + O t ( log t n ) τ A bit operations for full-message recovery.
Proof. Write c = x ∥ A ( T ) c=x\mathbin\Vert A(T) c = x ∥ A ( T ) . By Lemma C.8 , there is j ∗ j^* j ∗ with A ( T ) ∈ E t ( y [ j ∗ + 1 , ∣ y ∣ ] ) A(T)\in\mathcal{E}_t(y_{[j^*+1,|y|]}) A ( T ) ∈ E t ( y [ j ∗ + 1 , ∣ y ∣ ] ) and x ∈ E t ( y [ 1 , j ∗ ] ) x\in\mathcal{E}_t(y_{[1,j^*]}) x ∈ E t ( y [ 1 , j ∗ ] ) . For any fixed j j j , two tag-codewords u , u ′ ∈ E t ( y [ j + 1 , ∣ y ∣ ] ) ∩ A ( { 0 , 1 } h ) u,u'\in\mathcal{E}_t(y_{[j+1,|y|]})\cap A(\{0,1\}^{h}) u , u ′ ∈ E t ( y [ j + 1 , ∣ y ∣ ] ) ∩ A ({ 0 , 1 } h ) satisfy d D L ( u , u ′ ) ≤ d L ( u , u ′ ) ≤ 2 t d_{\mathrm{DL}}(u,u')\le d_L(u,u')\le2t d DL ( u , u ′ ) ≤ d L ( u , u ′ ) ≤ 2 t and hence u = u ′ u=u' u = u ′ . Thus Step 1 adds ( j ∗ , T , A ( T ) ) (j^*,T,A(T)) ( j ∗ , T , A ( T )) to T \mathcal{T} T , and x x x passes Step 2. Conversely, any ( x ′ , u ) (x',u) ( x ′ , u ) passing Step 2 satisfies d D L ( x ′ ∥ u , y ) ≤ d L ( x ′ ∥ u , y ) ≤ t d_{\mathrm{DL}}(x'\mathbin\Vert u,y)\le d_L(x'\mathbin\Vert u,y)\le t d DL ( x ′ ∥ u , y ) ≤ d L ( x ′ ∥ u , y ) ≤ t and passes Step 1 of Procedure B.2, so Lemma B.3 gives x ′ ∥ u = c x'\mathbin\Vert u=c x ′ ∥ u = c and correctness of Step 3.
For the running time, Step 1 checks at most 2 t + 1 2t+1 2 t + 1 values of j j j ; for each j j j , ∣ y [ j + 1 , ∣ y ∣ ] ∣ ≤ N + 2 t = O t ( log n ) |y_{[j+1,|y|]}|\le N+2t=O_t(\log n) ∣ y [ j + 1 , ∣ y ∣ ] ∣ ≤ N + 2 t = O t ( log n ) , so E t ( y [ j + 1 , ∣ y ∣ ] ) \mathcal{E}_t(y_{[j+1,|y|]}) E t ( y [ j + 1 , ∣ y ∣ ] ) has O t ( log t n ) O_t(\log^t n) O t ( log t n ) entries and Step 1 makes O t ( log t n ) O_t(\log^t n) O t ( log t n ) queries. For each of the at most 2 t + 1 2t+1 2 t + 1 triples in T \mathcal{T} T , Step 2 enumerates O t ( n t ) O_t(n^t) O t ( n t ) candidate x ′ x' x ′ , spending O t ( n log n ) O_t(n\log n) O t ( n log n ) bit operations for Horner’s rule and O t ( n ) O_t(n) O t ( n ) bit operations to test d L ( x ′ ∥ u , y ) ≤ t d_L(x'\mathbin\Vert u,y)\le t d L ( x ′ ∥ u , y ) ≤ t via banded dynamic programming [50 ] . Finally, Step 3 takes O t ( n 2 t + 2 log 2 n ) O_t(n^{2t+2}\log^2 n) O t ( n 2 t + 2 log 2 n ) bit operations by Lemma C.5 .
Table 7. Summary of bit-operation costs for fixed t t t and the parameters of Section 4.
Bootstrapping the tag code
The greedy tag-code construction in Section 4 requires n 6 t + 2 + o ( 1 ) n^{6t+2+o(1)} n 6 t + 2 + o ( 1 ) precomputation time. Since the tag itself has length h = O t ( log n ) h = O_t(\log n) h = O t ( log n ) and the DL channel is self-splittable, we can reduce the precomputation time to polylog ( n ) \operatorname{polylog}(n) polylog ( n ) by using our own greedy code construction at block length N h = O t ( log n ) N_h = O_t(\log n) N h = O t ( log n ) as the tag code. We first state this one-step bootstrapping reduction for a general code family and then specialize it to the DL code family.
A general bootstrapping lemma
Given a family of codes of block length ℓ \ell ℓ and message length M ( ℓ ) M(\ell) M ( ℓ ) , we obtain a code for h h h -bit tags by choosing the smallest ℓ > h \ell> h ℓ > h with M ( ℓ ) ≥ h M(\ell) \ge h M ( ℓ ) ≥ h and padding the h h h -bit tag with trailing zeroes. To invert this map and test membership in its image, we run the decoder of the length-ℓ \ell ℓ code, check that the recovered message ends with zeroes, and re-encode.
Lemma D.1 (Bootstrapping). Let E = ( E ℓ ) ℓ ≥ 1 \mathcal{E} = (\mathcal{E}_\ell)_{\ell\ge1} E = ( E ℓ ) ℓ ≥ 1 be a channel with u ∈ E ℓ ( u ) u \in\mathcal{E}_\ell(u) u ∈ E ℓ ( u ) for all u ∈ { 0 , 1 } ℓ u \in\{0,1\}^\ell u ∈ { 0 , 1 } ℓ . Suppose that for every ℓ ≥ ℓ 0 \ell\ge\ell_0 ℓ ≥ ℓ 0 , there is a code C ℓ ⊆ { 0 , 1 } ℓ \mathcal{C}_\ell\subseteq\{0,1\}^\ell C ℓ ⊆ { 0 , 1 } ℓ correcting E ℓ \mathcal{E}_\ell E ℓ , an injective encoder Enc ℓ : { 0 , 1 } M ( ℓ ) → C ℓ \operatorname{Enc}_\ell: \{0,1\}^{M(\ell)} \to\mathcal{C}_\ell Enc ℓ : { 0 , 1 } M ( ℓ ) → C ℓ , and a decoder Dec ℓ \operatorname{Dec}_\ell Dec ℓ that halts on every input and returns μ \mu μ on every valid channel output y ∈ E ℓ ( Enc ℓ ( μ ) ) y \in\mathcal{E}_\ell(\operatorname{Enc}_\ell(\mu)) y ∈ E ℓ ( Enc ℓ ( μ )) . Assume that given ℓ \ell ℓ , one can compute M ( ℓ ) M(\ell) M ( ℓ ) in time θ ( ℓ ) \theta(\ell) θ ( ℓ ) , perform the precomputation for C ℓ \mathcal{C}_\ell C ℓ in time P ( ℓ ) P(\ell) P ( ℓ ) , and then run Enc ℓ \operatorname{Enc}_\ell Enc ℓ and Dec ℓ \operatorname{Dec}_\ell Dec ℓ in time Time ( ℓ ) \operatorname{Time}(\ell) Time ( ℓ ) , where θ \theta θ , P P P , Time \operatorname{Time} Time , R R R are nondecreasing functions satisfying ℓ − M ( ℓ ) ≤ R ( ℓ ) ≤ ℓ / 2 \ell- M(\ell) \le R(\ell) \le\ell/2 ℓ − M ( ℓ ) ≤ R ( ℓ ) ≤ ℓ /2 for all ℓ ≥ ℓ 0 \ell\ge\ell_0 ℓ ≥ ℓ 0 .
Then for every h ≥ ℓ 0 h \ge\ell_0 h ≥ ℓ 0 , there is an integer N h N_h N h with h < N h ≤ 2 h h < N_h \le2h h < N h ≤ 2 h and N h − h ≤ 1 + R ( 2 h ) N_h - h \le1 + R(2h) N h − h ≤ 1 + R ( 2 h ) , together with an injective map A h : { 0 , 1 } h → { 0 , 1 } N h A_h : \{0,1\}^h \to\{0,1\}^{N_h} A h : { 0 , 1 } h → { 0 , 1 } N h whose images are pairwise non-confusable under E N h \mathcal{E}_{N_h} E N h . Finding N h N_h N h and precomputing A h A_h A h takes O ( h θ ( 2 h ) + P ( 2 h ) ) O(h\theta(2h) + P(2h)) O ( h θ ( 2 h ) + P ( 2 h )) time, after which evaluating A h A_h A h , testing membership in A h ( { 0 , 1 } h ) A_h(\{0,1\}^h) A h ({ 0 , 1 } h ) , and computing A h − 1 A_h^{-1} A h − 1 each take O ( Time ( 2 h ) + h ) O(\operatorname{Time}(2h) + h) O ( Time ( 2 h ) + h ) time.
Proof. Let N h = min { ℓ ∈ { h + 1 , … , 2 h } : M ( ℓ ) ≥ h } N_h = \min\{\ell\in\{h+1,\ldots,2h\} : M(\ell) \ge h\} N h = min { ℓ ∈ { h + 1 , … , 2 h } : M ( ℓ ) ≥ h } , which is well-defined since M ( 2 h ) ≥ 2 h − R ( 2 h ) ≥ h M(2h) \ge2h - R(2h) \ge h M ( 2 h ) ≥ 2 h − R ( 2 h ) ≥ h . If N h = h + 1 N_h = h+1 N h = h + 1 , then N h − h = 1 N_h-h=1 N h − h = 1 ; otherwise M ( N h − 1 ) < h M(N_h-1) < h M ( N h − 1 ) < h , so N h − h ≤ 1 + ( N h − 1 − M ( N h − 1 ) ) ≤ 1 + R ( N h − 1 ) ≤ 1 + R ( 2 h ) N_h-h \le1+(N_h-1-M(N_h-1)) \le1+R(N_h-1) \le1+R(2h) N h − h ≤ 1 + ( N h − 1 − M ( N h − 1 )) ≤ 1 + R ( N h − 1 ) ≤ 1 + R ( 2 h ) .
For T ∈ { 0 , 1 } h T \in\{0,1\}^h T ∈ { 0 , 1 } h , define A h ( T ) = Enc N h ( T ∥ 0 M ( N h ) − h ) A_h(T) = \operatorname{Enc}_{N_h}(T\Vert0^{M(N_h)-h}) A h ( T ) = Enc N h ( T ∥ 0 M ( N h ) − h ) . Since Enc N h \operatorname{Enc}_{N_h} Enc N h is injective and its image corrects E N h \mathcal{E}_{N_h} E N h , A h A_h A h is injective and distinct images of A h A_h A h are non-confusable under E N h \mathcal{E}_{N_h} E N h . To test whether u ∈ { 0 , 1 } N h u \in\{0,1\}^{N_h} u ∈ { 0 , 1 } N h lies in A h ( { 0 , 1 } h ) A_h(\{0,1\}^h) A h ({ 0 , 1 } h ) and compute A h − 1 ( u ) A_h^{-1}(u) A h − 1 ( u ) , we run Dec N h ( u ) \operatorname{Dec}_{N_h}(u) Dec N h ( u ) , check that it returns a message μ ∈ { 0 , 1 } M ( N h ) \mu\in\{0,1\}^{M(N_h)} μ ∈ { 0 , 1 } M ( N h ) ending with M ( N h ) − h M(N_h)-h M ( N h ) − h zeroes and satisfying Enc N h ( μ ) = u \operatorname{Enc}_{N_h}(\mu)=u Enc N h ( μ ) = u , and if so output μ [ 1 , h ] \mu_{[1,h]} μ [ 1 , h ] . If u = A h ( T ) u=A_h(T) u = A h ( T ) , then u ∈ E N h ( u ) u \in\mathcal{E}_{N_h}(u) u ∈ E N h ( u ) , so Dec N h ( u ) \operatorname{Dec}_{N_h}(u) Dec N h ( u ) returns T ∥ 0 M ( N h ) − h T\Vert0^{M(N_h)-h} T ∥ 0 M ( N h ) − h and the test accepts with output T T T ; conversely, if the re-encoding check Enc N h ( μ ) = u \operatorname{Enc}_{N_h}(\mu)=u Enc N h ( μ ) = u passes, then u = A h ( μ [ 1 , h ] ) u=A_h(\mu_{[1,h]}) u = A h ( μ [ 1 , h ] ) regardless of how Dec N h \operatorname{Dec}_{N_h} Dec N h behaves on invalid inputs.
Finally, finding N h N_h N h by testing ℓ = h + 1 , … , 2 h \ell=h+1,\ldots,2h ℓ = h + 1 , … , 2 h takes O ( h θ ( 2 h ) ) O(h\theta(2h)) O ( h θ ( 2 h )) time, precomputing C N h \mathcal{C}_{N_h} C N h takes at most P ( 2 h ) P(2h) P ( 2 h ) time, and each operation of A h A_h A h makes at most one call to Enc N h \operatorname{Enc}_{N_h} Enc N h and one call to Dec N h \operatorname{Dec}_{N_h} Dec N h in time O ( Time ( 2 h ) + h ) O(\operatorname{Time}(2h)+h) O ( Time ( 2 h ) + h ) .
Application to DL codes
Fix t ≥ 1 t\ge1 t ≥ 1 , and let ( C ℓ ) ℓ ≥ ℓ 0 (C_\ell)_{\ell\ge\ell_0} ( C ℓ ) ℓ ≥ ℓ 0 be the greedy DL code family of Theorem 4.3 (b) at block length ℓ \ell ℓ , decoded with Procedure B.2. At length ℓ \ell ℓ , the code uses parameters L ℓ = D t D L ℓ 2 t L_\ell=D_t^{\mathrm{DL}}\ell^{2t} L ℓ = D t DL ℓ 2 t , b ℓ = ⌈ log ( 2 L ℓ ℓ ) ⌉ b_\ell=\lceil\log(2L_\ell\ell)\rceil b ℓ = ⌈ log ( 2 L ℓ ℓ )⌉ , r ℓ = ⌈ log ( 2 L ℓ ) ⌉ r_\ell=\lceil\log(2L_\ell)\rceil r ℓ = ⌈ log ( 2 L ℓ )⌉ , h ℓ = 2 b ℓ + r ℓ h_\ell=2b_\ell+r_\ell h ℓ = 2 b ℓ + r ℓ , and suffix length N g ( ℓ ) = h ℓ + ⌈ 2 t log ( 20 h ℓ ) + log ( 2 t + 1 ) ⌉ N_g(\ell)=h_\ell+\lceil2t\log(20h_\ell)+\log(2t+1)\rceil N g ( ℓ ) = h ℓ + ⌈ 2 t log ( 20 h ℓ ) + log ( 2 t + 1 )⌉ . Its message length M ( ℓ ) = ℓ − N g ( ℓ ) + 2 b ℓ − 2 M(\ell)=\ell-N_g(\ell)+2b_\ell-2 M ( ℓ ) = ℓ − N g ( ℓ ) + 2 b ℓ − 2 is a closed-form function computable in θ ( ℓ ) = polylog ( ℓ ) \theta(\ell)=\operatorname{polylog}(\ell) θ ( ℓ ) = polylog ( ℓ ) time, with redundancy ℓ − M ( ℓ ) ≤ R ( ℓ ) : = 2 t log ℓ + 2 t log log ℓ + c t \ell-M(\ell)\le R(\ell):=2t\log\ell+2t\log\log\ell+c_t ℓ − M ( ℓ ) ≤ R ( ℓ ) := 2 t log ℓ + 2 t log log ℓ + c t . Enlarge ℓ 0 \ell_0 ℓ 0 so that the greedy construction is valid and R ( ℓ ) ≤ ℓ / 2 R(\ell)\le\ell/2 R ( ℓ ) ≤ ℓ /2 for every ℓ ≥ ℓ 0 \ell\ge\ell_0 ℓ ≥ ℓ 0 . For sufficiently large n n n , the outer tag length satisfies h ≥ ℓ 0 h\ge\ell_0 h ≥ ℓ 0 . By Theorem 4.3 (b) and Theorem C.7 , we may take the nondecreasing bounds
P ( ℓ ) = C t ℓ 6 t + 2 ( log ℓ ) 4 t + 1 , Time ( ℓ ) = C t ℓ 2 t + 2 log 2 ℓ P(\ell)=C_t\ell^{6t+2}(\log\ell)^{4t+1}, \qquad\operatorname{Time}(\ell)=C_t\ell^{2t+2}\log^2\ell P ( ℓ ) = C t ℓ 6 t + 2 ( log ℓ ) 4 t + 1 , Time ( ℓ ) = C t ℓ 2 t + 2 log 2 ℓ
for a sufficiently large constant C t C_t C t . In particular, P ( ℓ ) = ℓ 6 t + 2 + o ( 1 ) P(\ell)=\ell^{6t+2+o(1)} P ( ℓ ) = ℓ 6 t + 2 + o ( 1 ) .
Applying Lemma D.1 to this family for an outer tag of length h = ( 6 t + 2 ) log n + O t ( 1 ) h=(6t+2)\log n+O_t(1) h = ( 6 t + 2 ) log n + O t ( 1 ) yields a tag code A h : { 0 , 1 } h → { 0 , 1 } N h A_h:\{0,1\}^h\to\{0,1\}^{N_h} A h : { 0 , 1 } h → { 0 , 1 } N h satisfying (7) for N = N h N=N_h N = N h . Its overhead satisfies
N h − h ≤ 1 + R ( 2 h ) = 2 t log h + 2 t log log h + O t ( 1 ) = 2 t log log n + O t ( log log log n ) . N_h-h\le1+R(2h)=2t\log h+2t\log\log h+O_t(1)=2t\log\log n+O_t(\log\log\log n). N h − h ≤ 1 + R ( 2 h ) = 2 t log h + 2 t log log h + O t ( 1 ) = 2 t log log n + O t ( log log log n ) .
Because h = O t ( log n ) h=O_t(\log n) h = O t ( log n ) , the precomputation time for A h A_h A h (whose own inner tag code is a greedy table of length O t ( log h ) = O t ( log log n ) O_t(\log h)=O_t(\log\log n) O t ( log h ) = O t ( log log n ) ) is O ( h θ ( 2 h ) + P ( 2 h ) ) = ( log n ) 6 t + 2 + o ( 1 ) = polylog ( n ) O(h\theta(2h)+P(2h))=(\log n)^{6t+2+o(1)}=\operatorname{polylog}(n) O ( h θ ( 2 h ) + P ( 2 h )) = ( log n ) 6 t + 2 + o ( 1 ) = polylog ( n ) , and each operation of A h A_h A h takes time τ A = O ( Time ( 2 h ) + h ) = O t ( log 2 t + 2 n ⋅ log 2 log n ) = polylog ( n ) \tau_A=O(\operatorname{Time}(2h)+h)=O_t(\log^{2t+2}n\cdot\log^2\log n)=\operatorname{polylog}(n) τ A = O ( Time ( 2 h ) + h ) = O t ( log 2 t + 2 n ⋅ log 2 log n ) = polylog ( n ) . Substituting A h A_h A h and τ A = polylog ( n ) \tau_A=\operatorname{polylog}(n) τ A = polylog ( n ) into Lemma 3.2 and Theorem C.7 gives the bootstrapped code of Theorem 4.3 (a).
AI methodology statement
We used generative AI tools (OpenAI GPT-6 Astra and Google Gemini Flash 3.8) to assist in the research and preparation of this manuscript. Specifically, the tools were used to explore and streamline the boundary-projection and competitor-ball framework in § 4 , as well as for language polishing, clarity improvements, and TikZ typesetting across the manuscript. The authors conceived the core seed recycling mechanism, independently checked and established the correctness and rigor of all mathematical statements, proofs, and analyses, and verified the accuracy and originality of all content, including references. The authors take full responsibility for the entire submission.