In this work, we investigate the hardness of computing minimum distance, as well as the hardness of syndrome decoding, for rank-metric codes. It is known (Gaborit and Zémor, IEEE TIT 2016) that for Fqm-linear rank-metric codes of length N, minimum distance when m=O(N) and syndrome decoding when m=O(N2) are NP-hard under randomized reductions. We obtain a derandomization of these results, and a bit more.
We show that for any fixed small ε>0, for Fqm-linear rank-metric codes of length N with m=O(N1+ε), the problems of minimum distance, nearest codeword, and syndrome decoding are NP-hard under deterministic reductions. Further, we can prescribe the rate, that is, if we restrict to codes having any fixed rational rate R∈(0,1), then the NP-hardness for all three problems persists.
Our main technical contribution is simple, and possibly of independent interest. The reduction of Gaborit and Zémor (IEEE TIT 2016) relies on a distance-preserving embedding of a Hamming-metric code into a rank-metric code, obtained by multiplying its coordinates by a uniformly random vector. We show that we can choose an explicit vector from a slightly larger extension field.
*Syracuse University
†Purdue University
‡Ben-Gurion University of the Negev
1 Introduction
The theory of error-correcting codes is concerned with encoding messages in a structured way, so that they can be recovered even after being subject to noise. Two notions that are vital to such recovery are the redundancy introduced by incorporating additional information derived from the message symbols into the codeword symbols, and the separation between distinct codewords. The tradeoff between these two requirements is central to the study of error-correcting codes.
Codes and distance functions. A code is a nonempty subset C⊆ΣN over a finite alphabet Σ, with a distance function on ΣN representing the model of noise. One of the prototypical models uses the Hamming distance across coordinates. Even more structured is the setting of linear codes, where the alphabet is a finite field Fq. A linear code C≤FqN is an Fq-linear subspace, and its minimum distance dH(C) is the least Hamming weight of a nonzero codeword. Computing dH(C) is the minimum distance problem (MDP). In the nearest codeword problem (NCP), we instead seek a codeword closest to a given word. This is equivalent to syndrome decoding (SD). These are basic computational problems in coding theory. Syndrome decoding was proved NP-complete in [BMT78]; the same was later proved for minimum distance in [Var97]. Subsequent work established NP-hardness of approximation within any constant factor under randomized [DMS03] and then deterministic reductions [CW12; AK11; BGR25].
Yet another important model is to expand codewords over an extension field to obtain a matrix over a base field, and replace the Hamming distance across coordinates by the rank distance. The resulting codes are called rank-metric codes, and these are the focus of our work. For x∈FqmN, the rank weight is wR(x):=dimFq(⟨x1,…,xN⟩Fq), the rank of the m×N matrix over Fq obtained by coordinate expansion in a basis of Fqm over Fq. An Fqm-linear rank-metric code is an Fqm-subspace C≤FqmN. Introduced in [Del78; Gab85], these are the rank-metric counterparts of Hamming linear codes. Gabidulin codes are the analogue of Reed–Solomon codes. They are used in network coding and form the basis of rank-based cryptography, whose security rests on rank syndrome decoding hardness.
It must be noted that rank-metric codes are different from the related matrix codes. A matrix code is an arbitrary Fq-subspace of FqM×N, for any number of rows M. Placing a Hamming word on a matrix diagonal preserves its weight [Cou01], so hardness in the Hamming metric implies hardness for matrix codes. The related MinRank problem is NP-complete [BFS99]. An Fqm-linear code must also be closed under multiplication by Fqm, which the diagonal embedding need not ensure. The known hardness results for Fqm-linear rank-metric codes use the randomized reduction of [GZ16]: multiply the coordinates of a Hamming code C by α∈(Fqm∗)N and take the Fqm-linear span Dα(C)Fqm. For uniformly random α and m>2qN, this code's rank distance equals dH(C) with high probability [GZ16, Thm. 8]. Their randomized reduction for rank syndrome decoding requires m>N2 [GZ16, Thm. 10]. These reductions only exclude ZPP algorithms unless NP = ZPP. We ask whether these reductions can be made deterministic.
Is the minimum distance problem for Fqm-linear rank-metric codes NP-hard under deterministic reductions? Does this hold at every fixed rate?
The first part was open even for exact minimum distance without parameter restrictions. We also prescribe the rate R=dimFqm(C)/N, which is fixed in applications such as rank-based cryptography. Our reductions produce hard instances at every rational rate R∈(0,1), while retaining positive relative distance and a threshold proportional to the length.
1.1 Our results
An explicit distance-preserving lift. Our main technical result is a deterministic choice of the multiplier α in the diagonal embedding of [GZ16]. It converts a Hamming-metric code into a rank-metric code with the same minimum distance. For C≤FqN and α∈(Fqm∗)N, define Dα:=diag(α) and Dα(C):={α∘c:c∈C}, where α∘c:=(α1c1,…,αNcN). Write Dα(C)Fqm:=⟨Dα(C)⟩Fqm for its Fqm-linear span. The reduction in [GZ16] chooses α at random; we give an explicit choice.
Theorem 1.1 (Explicit diagonal lift). Let C≤FqN be a nonzero linear code of dimension k. Let Fqm be an extension field with m>k(N−k), let ϑ∈Fqm∖{0} have degree m over Fq, and let α=(1,ϑ,ϑ2,…,ϑN−1). Then dR(Dα(C)Fqm)=dH(C).
For every α∈(Fqm∗)N, the inequality dR(Dα(C)Fqm)≤dH(C) is immediate. Equality can fail for a bad choice of α. For instance, if α∈(Fq∗)N, the lifted code has rank distance 1. Theorem 1.1 gives an explicit choice of α for which equality holds.
Deterministic hardness in the rank metric. Theorem 1.1 requires m quadratic in N when the rate is constant. Repeating every coordinate of the Hamming code before lifting keeps the dimension k fixed while multiplying the length. This lowers the required degree to m=O(N1+ε). Applying the lift to any deterministic Hamming hardness result [AK11; BGR25] then gives the following.
Theorem 1.2 (Rank minimum distance). For every prime power q, every Γ>1 and every ε>0, it is NP-hard under deterministic polynomial-time reductions to distinguish Fqm-linear codes C≤FqmN with dR(C)≤T from those with dR(C)>ΓT. This holds even when restricted to instances with m=O(N1+ε), dR(C)≥ηN and T≥θN, for constants η,θ>0 that depend only on q, Γ and (if prescribed) the rate. Moreover, for every rational R∈(0,1), the code may be required to have rate exactly R.
Theorem 1.3 (Rank nearest codeword and syndrome decoding). For every prime power q, every rational R∈(0,1), every Γ>1 and every ε>0, rank nearest codeword and rank syndrome decoding are NP-hard to approximate within gap Γ under deterministic reductions. This holds for instances of kernel rate exactly R with m=O(N1+ε) and threshold T≥θN. The kernel code may also be required to have rank distance at least ηN, where η,θ>0 depend only on q,R,Γ.
Theorem 1.3 replaces the randomized rank syndrome decoding reduction of [GZ16] by a deterministic one. For 0<ε<1, its extension degree m=O(N1+ε) also improves on their requirement m>N2. Their randomized minimum-distance reduction uses m=O(N).
The formal problem definitions are in Section 2.
1.2 Technical Overview
Our reductions start from a known NP-hard problem in the Hamming metric and preserve the gap between YES and NO instances at each step. We describe the source problem, the four steps used to prove Theorems 1.1–1.3, and how we combine them.
The source problem
For the reductions below, we start from gap minimum distance in the Hamming metric. We state the source and derive its quantitative properties in Section 5.
(S) Hamming source. For every Γ>1 there is a deterministic polynomial-time reduction from 3SAT to pairs (C,T), where C≤Fqn is a nonzero linear code and T is an integer, such that
YES⟹dH(C)≤T,NO⟹dH(C)>ΓT.
Every output satisfies dH(C)≥η0n and T≥θ0n, where η0,θ0>0 depend only on q, Γ.
The hardness of the source problem (S) follows from the results of [AK11; BGR25].
For the decoding problems, we also need a low-weight witness whose value at a specified coordinate is 1. The reduction of [BGR25] provides this additional property.
(S') Distinguished-coordinate source. For every Γ>1 there is a deterministic polynomial-time reduction from 3SAT to triples (V,j,T) with V≤Fqn, integer T, and j∈[n], such that
YES⟹∃v∈V:vj=1,∥v∥0≤T,NO⟹∀v∈V∖{0}:∥v∥0>ΓT.
Every output satisfies T≥θ0n and ∥v∥0≥η0n for all v∈V∖{0}, where η0,θ0>0 depend only on q,Γ. The code V may be zero in the NO case.
Four steps
The lift (P1) preserves minimum distance, as stated in Theorem 1.1. Coordinate repetition (P2) lowers the required extension degree, and rate calibration (P3) fixes the rate exactly. Finally, (P4) converts a distinguished-coordinate source to a decoding instance. We show that combining these steps preserves the gap, positive relative distance, and a threshold proportional to the length.
(P1) The explicit diagonal lift (Hamming to rank distance) For a nonzero code C≤FqN of dimension k, use α=(1,ϑ,…,ϑN−1), where ϑ=0 has degree m>k(N−k). Theorem 1.1 gives dR(Dα(C)Fqm)=dH(C), preserving thresholds and gaps. The proof has three steps.
Step 1. By Lemma 3.1, the required lower bound is equivalent to the following condition for every U≤FqN with r=dimFq(U)<dH(C):
Dα(C)Fqm∩UFqm={0}⟺rankFqm[DαG∣B]=k+r.
Here G∈FqN×k and B∈FqN×r have columns forming bases of C and U (Lemma 3.2). A random choice handles each U separately, followed by a union bound [GZ16]; our choice handles all U at once.
Step 2. For D(t):=diag(1,t,…,tN−1), a top-degree argument gives D(t)CFq(t)∩UFq(t)={0}, rankFq(t)[D(t)G∣B]=k+r. A nonzero intersection would give 0=c∈C with dH(C)≤∥c∥0≤r<dH(C), a contradiction. Thus PR(t):=det([D(t)G∣B]R)=0 for some R⊆[N] with ∣R∣=k+r (Lemma 3.3).
Step 3. Write PR(t)=taQR(t), where 0=QR(t)∈Fq[t] and degt(QR(t))≤k(N−k)<m. Thus QR(ϑ)=0, and PR(ϑ)=0 since ϑ=0 (Lemma 3.4).
The embedding C↦Dα(C)Fqm is that of [GZ16]. (P1) provides an explicit multiplier to derandomize their construction. The strategy of replacing a random point by an indeterminate, proving nonvanishing over Fq(t), and substituting an element of large degree is the usual way to derandomize a Schwartz-Zippel argument. The complete proof of Theorem 1.1 is presented in Section 3.
(P2) Coordinate repetition (lowering the extension degree) By Lemma 2.4, repeating each coordinate L times gives (n,k,d,T)↦(nL,k,Ld,LT), preserving the gap and relative distance. For an integer B≥1, set L=nB−1 and N=nB. Then k≤n gives k(N−k)≤nN=N1+1/B.
Coordinate repetition preserves the gap and appears, for example, in reductions between metrics [BR+22]. Here, it increases the length while preserving the dimension. Since the degree bound in (P1) depends on both, repetition lowers the exponent in that bound.
(P3) Rate calibration (fixing the rate exactly) For a rank-metric code C≤Fqmn, write R=a/b in lowest terms. Choose an explicit Gabidulin code D with dR(D)≥n and rate above R, long enough that z:=b⋅dim(C⊕D)−a⋅length(C⊕D)≥0. Then
rate((C⊕D)⊕a⊕0z)=a⋅length(C⊕D)+za⋅dim(C⊕D)=ba.
For nonzero C, its minimum distance is min{dR(C),dR(D)}=dR(C), since dR(C)≤n. The construction requires m≥κRn for a constant κR depending only on R. We include this linear lower bound when choosing the field degree for the lift.
For a decoding instance with target u, use the same constructed code and target ((u,0),0,…,0). Only the first copy of C is translated. Projection onto the original coordinates and extension by zeros show that the minimum weight in the resulting affine space is unchanged. The distance bound for the auxiliary code also preserves a positive relative distance for the decoding code. Section 4 proves these assertions, including the case C=0.
(P4) The affine slice (from minimum distance to decoding) Given a source (V,j,T) as in (S′), first test A:={v∈V:vj=1} for emptiness. If A=∅, output the fixed NO instance constructed in Section 6. Otherwise choose a∈A, and put V0:={v∈V:vj=0}. Then A=a+V0 and dist(−a,V0)=minv∈A∥v∥0. In the YES case, A contains a word of weight at most T. In the NO case, every word of A is a nonzero element of V, so it has weight greater than ΓT. Thus (V0,−a,T) has the same gap, and Lemma 2.3 gives syndrome decoding. The same argument works in the rank metric after (P1).
Passing between minimum distance and nearest codeword by fixing one coordinate is the coding analogue of the reduction from SVP to CVP in [GM+99]. This reduction replaces a basis vector bi by 2bi and uses bi as the target, so a closest vector corresponds to a short vector with an odd i-th coefficient. The embedding in [Kan87] goes the other way. For codes, the distinguished-coordinate version that yields a single Karp reduction is given in [BGR25].
For minimum distance, we apply coordinate repetition to the ordinary Hamming source, then the lift, and finally rate calibration. For decoding, we repeat and lift the distinguished-coordinate source, fix the corresponding coordinate to its required nonzero value, and then calibrate the linear code of differences. Section 6 verifies both reductions and their parameter bounds.
Figure 1 records these dependencies and the order of the constructions.
1.3 Related work
Concurrent work. The current manuscript is under submission. We recently noticed a concurrent work [Gab26] that achieves deterministic reduction via a different idea, and in fact, for the stronger parameter setting m=O(N). While we focused on derandomizing the specific reduction in [GZ16], the concurrent work [Gab26] sets up a completely different deterministic reduction, also of independent interest.
Figure 1: Dependencies of the rank-metric hardness results. Shaded boxes are the ordinary and distinguished-coordinate sources derived in Section 5; dashed boxes are intermediate instances. (P1) is the explicit diagonal lift (Theorem 1.1); (P2) is repetition before lifting (Lemma 3.5); (P3) is rank calibration using a Gabidulin auxiliary code (Lemma 4.2); and (P4) is the affine slice. Corollary 4.3 combines the three steps on the left. The right branch shows the nonempty-slice case: we lift the source code before fixing the coordinate and calibrate the direction code of A. An empty source slice gives the fixed calibrated NO instance of Section 6. For repeated length N1, we choose m≥κRN1 to support calibration. For each rational R∈(0,1) and fixed ε>0, the final code or decoding kernel has rate exactly R, distance at least ηN, and threshold T≥θN, with m=OR,ε(N1+ε) for final length N. Here η,θ>0 depend only on q,R,Γ. Lemma 2.3 gives the syndrome form.
Hamming metric. Syndrome decoding was shown to be NP-complete in [BMT78], and minimum distance in [Var97], using a Reed–Solomon code concatenated with a Hadamard code. NCP was proved NP-hard to approximate within any constant factor via PCPs in [AB+97]. The analogous result for MDP was proved under randomized reductions, using locally dense codes, in [DMS03], which also introduced the relatively near codeword problem. The locally dense code construction was derandomized in [CW12]. A simple deterministic reduction through tensor codes was given in [AK11]; its hard instances have rate and relative distance bounded below by constants. The binary case was simplified in [Mic14]. PCP-free deterministic APX-hardness of NCP and MDP was established in [BGR25]. This argument is incorporated in [BG+25], which also gives PCP-free randomized hardness for sparsest vector problems. We develop our Hamming source from [BGR25] in Section 5; either [AK11] or [BGR25] suffices for the minimum-distance hardness.
Rank and matrix-rank metrics. Rank-metric codes were introduced in [Del78], and independently in [Gab85; Rot91]. MinRank for general matrix spaces is NP-complete [BFS99], and the diagonal embedding transfers Hamming hardness to matrix codes [Cou01]. For Fqm-linear codes, the only previous hardness result is the randomized reduction of [GZ16]. It was extended, still with randomness, to the sum-rank metric [PRR22], and rank decoding over finite principal ideal rings is at least as hard as over fields [KK21]. On the algorithmic side, the best known attacks on rank syndrome decoding take exponential time [BB+20b; BB+20a].
Organization
Section 2 fixes notation and the problem definitions. Section 3 proves the explicit diagonal lift and uses repetition to obtain the required extension degree. Section 4 gives the rank-metric exact-rate calibration. Section 5 derives the quantitative Hamming source from the construction of [BGR25]. Section 6 combines these ingredients to prove the rank minimum-distance and decoding results.
AI disclosure. No part of the research involved any use of AI-based tools. A complete version of the manuscript was passed through an AI-based tool for recommendations on improving structure and presentation. Some of these were found useful, and were implemented.
2 Preliminaries
Throughout, q is a fixed prime power and Fq is the field with q elements. For an integer m≥1, Fqm is the field with qm elements. All logarithms are base 2, [N]:={1,…,N}, and ⟨S⟩K denotes the K-linear span of a set S.
Linear codes
Let K be a field and Ω a finite-dimensional K-vector space, the ambient space. A (K-linear) code is a subspace C≤Ω. Its rate is rate(C):=dimK(C)/dimK(Ω). We use (K,Ω)∈{(Fq,FqN),(Fqm,FqmN)}. Thus a vector code of length N and dimension k has rate k/N.
Extension field.
In the rank metric, m is part of the input. We present Fqm=Fq[z]/(f(z)), where f(z)∈Fq[z] is monic irreducible and degz(f(z))=m. Each element is stored as a polynomial of degree less than m, using O(m⋅logq) bits. A generator matrix for a code of length N and dimension k therefore uses Θ(kNm⋅logq) bits. We require m≤poly(N) throughout.
An element ϑ∈Fqm has degree d over Fq if its minimal polynomial has degree d, equivalently if Fq(ϑ)=Fqd. It has degree exactly m if and only if Fq(ϑ)=Fqm. Then 0=p(z)∈Fq[z] and degz(p(z))<m imply p(ϑ)=0. We use this nonvanishing property, together with ϑ=0, for the lift in Section 3.
Lemma 2.1 (Deterministic finite-field construction). Fix a prime power q. For every m≥1, one can construct, deterministically in time poly(m), a monic irreducible f(z)∈Fq[z] of degree m [Sho90]. Then Fqm=Fq[z]/(f(z)), and ϑ=zmodf(z) has degree exactly m.
Proof. The construction is given by [Sho90]. Since f(z) is the minimal polynomial of zmodf(z), this element has degree m. □
Metrics and Operations
A metric setting M=(K,Ω,wt) consists of a field K⊇Fq, a finite-dimensional K-space Ω, and a weight wt:Ω→Z≥0 that (i) vanishes only at 0, (ii) satisfies wt(λx)=wt(x) for λ∈K∗, and (iii) satisfies wt(x+y)≤wt(x)+wt(y).
For a code C≤Ω, define d(C):=minc∈C∖{0}wt(c), with d({0}):=+∞. For an affine space A=a+C, call C its direction code, and define μ(a+C):=minc∈Cwt(a+c) and dist(b,C):=μ(b+C). In the rank metric we write μR for μ. We use the following two settings.
Setting
K
Ω
wt(x)
d(C)
Hamming HN
Fq
FqN
∥x∥0=∣{i:xi=0}∣
dH(C)
Rank RN,m
Fqm
FqmN
wR(x)=dimFq(⟨x1,…,xN⟩Fq)
dR(C)
The relative distance is δ(C):=d(C)/N. In the rank metric the scalars are Fqm.
For C≤Fqn and an integer L≥1, write C(L)≤FqnL for its L-fold coordinate repetition, the image under
For U≤Fqa and V≤Fqb, define the tensor code U⊗V:={X∈Fqa×b:X∗,j∈U∀j∈[b],Xi,∗∈V∀i∈[a]}, viewed row by row as a code of length ab. For C≤FqN, its scalar extension is CFqm:=C⊗FqFqm=⟨C⟩Fqm≤FqmN, with the same generator matrix and dimFqm(CFqm)=dimFq(C). Direct sums C1⊕C2 concatenate vector blocks; 0z denotes z zero coordinates. Lemma 2.4 records the elementary identities for these operations.
For α∈(Fqm∗)N, let Dα:=diag(α), acting by Dα:FqmN→FqmN, x↦α∘x. The diagonal lift [GZ16] is Dα(C)Fqm:=Dα⋅CFqm=⟨α∘c:c∈C⟩Fqm, with dimFqm(Dα(C)Fqm)=dimFq(C). If C=0, choose 0=c∈C with ∥c∥0=dH(C). Since α∘c has the same support as c, Lemma 2.4(2) gives
dR(Dα(C)Fqm)≤wR(α∘c)≤∥c∥0=dH(C).
The inequality can be strict: if C=0 and α∈(Fq∗)N, the lifted code contains nonzero words with all entries in Fq, which have rank weight 1. Theorem 1.1 gives an explicit α achieving equality.
Problems
All problems are promise problems Π=(ΠYES,ΠNO). An algorithm solves Π if it accepts ΠYES and rejects ΠNO, with no requirement elsewhere. A reduction is a deterministic polynomial-time map sending YES instances to YES instances and NO instances to NO instances. The parameters q,R,Γ,ε, and the constants used to construct auxiliary codes, are fixed before the input is read. Since a Γ-gap problem reduces to the Γ′-gap problem for every Γ′<Γ, we may assume Γ∈Q.
Definition 2.2 (Gap problems). Let M=(K,Ω,wt) be a metric setting, Γ≥1 and T∈Z>0. In each problem below the YES instances have opt ≤T and the NO instances have opt >ΓT.
Minimum distance Γ-GapMD[M]: given a nonzero code C≤Ω, opt :=d(C).
Nearest codeword Γ-GapNC[M]: given a code C≤Ω and b∈Ω, opt :=dist(b,C). In the syndrome form Γ-GapSD[M], one is given a K-linear map H:Ω→Kr for an integer r≥0, and a syndrome s∈Kr, with opt :=min{wt(x):x∈Ω,H(x)=s}, which is +∞ if no solution exists.
The rate of an instance is the rate of its code, or of its direction code C=kerH.
Codes are given by a basis. In the rank metric the input also contains m≤poly(N) and an irreducible f(z)∈Fq[z] with degz(f(z))=m, presenting Fqm=Fq[z]/(f(z)) as above.
Lemma 2.3 (Nearest codeword ≡ consistent syndrome decoding). In each setting, GapNC and the restriction of GapSD to consistent systems reduce to each other. The reductions preserve opt, T, the direction code and its rate. In particular, this applies when H has full row rank.
Proof of Lemma 2.3. Given (C,b,T), compute a full-row-rank H with kerH=C. The reduction and its solution set are
(C,b,T)⟼(H,H(b),T),{x:H(x)=H(b)}=b+C.
Conversely, solve the consistent system H(a)=s, and use
(H,s,T)⟼(kerH,a,T),{x:H(x)=s}=a+kerH.
Gaussian elimination detects an inconsistent syndrome system, whose optimum is +∞. Every nearest-codeword instance has a finite optimum. For hardness of unrestricted syndrome decoding, the consistent outputs already suffice. □
Elementary operations on codes
Lemma 2.4 (Elementary facts). 1. (Expansion.) Fix an Fq-basis of Fqm, and define Φ:FqmN→Fqm×N by taking the i-th column of Φ(x) to be the coordinate vector of xi. Then Φ is an Fq-linear bijection with wR(x)=rankΦ(x). For an Fqm-linear code C, we have
dimFq(Φ(C))=m⋅dimFqm(C).
(Rank versus Hamming.) wR(x)≤min{∥x∥0,m} for every x∈FqmN.
(Direct sums.) In both settings, d(C1⊕C2)=min{d(C1),d(C2)}, d(C⊕0z)=d(C), and μ((a+C)⊕D)=μ(a+C) for every linear D.
(Repetition.) C(L) has dimension dim(C) and dH(C(L))=L⋅dH(C).
(Tensoring.) dim(U⊗V)=dim(U)⋅dim(V) and dH(U⊗V)=dH(U)⋅dH(V).
Items (1) and (2) are proved below, Item (3) in the direct-sum lemmas below, and Items (4) and (5) in Lemmas 2.7 and 2.8.
The nonzero coordinates of x generate a subspace of the m-dimensional Fq-space Fqm, so
wR(x)≤min{∥x∥0,m}≤min{N,m},x∈FqmN.
In particular, dR(C)≤min{N,m} for every nonzero C≤FqmN. Rank weight is at most Hamming weight, and can be much smaller.
Fix an Fq-basis ξ=(ξ1,…,ξm) of Fqm, and write [a]ξ∈Fqm for the coordinate column of a∈Fqm. Coordinate expansion is the Fq-linear isomorphism
For an Fqm-linear code C≤FqmN, its restriction gives
dimFq(M(C))=dimFq(C)=m⋅dimFqm(C).
Lemma 3.1 expresses the same weight identity using the rational subspace Rat(x).
If the rows c1,…,ck of G∈Fqk×N form an Fq-basis of C, then
Fqmk⟶CFqm,(λ1,…,λk)⟼i=1∑kλici=λG
is an isomorphism: it is surjective by definition, and a nonzero k×k minor of G over Fq remains nonzero over Fqm. Thus dimFqm(CFqm)=k=dimFq(C).
For codes C1≤FqN and C2≤FqN′, their direct sum is
C1⊕C2:={(c1,c2):c1∈C1,c2∈C2}≤FqN+N′,
and the same definition applies over Fqm. We write 0z for the zero-dimensional code of length z, in either metric. The next two lemmas give the dimension and minimum distance of direct sums in the two metrics.
Lemma 2.5 (Direct sums and zero padding, Hamming metric). Let C1≤FqN and C2≤FqN′ be nonzero linear codes. Then
These two codewords give the reverse inequality. For zero padding, the map C→C⊕0z, x↦(x,0z) is an Fqm-linear isomorphism, and
⟨x1,…,xN,0,…,0⟩Fq=⟨x1,…,xN⟩Fq.
Thus it preserves dimension and rank distance.
To set the rate later, we will also use the following fact about affine spaces in either metric. If A=a+C is an affine space and D is a linear code in the same metric, then adjoining a new coordinate block ranging over D does not change the minimum weight:
μ(A⊕D)=μ(A).
Write (x,d) for the concatenated vector. The preceding identities give
wt(x,d)≥wt(x),wt(x,0)=wt(x),x∈A,d∈D,
and therefore
x∈A,d∈Dminwt(x,d)=x∈Aminwt(x)=μ(A).
Appending zero coordinates preserves every weight, so it preserves both the minimum weight in an affine space and the minimum nonzero weight of a code. We use these facts with Lemmas 2.5 and 2.6.
Lemma 2.7 (Tensor-product distance). For nonzero linear codes U≤Fqa and V≤Fqb, let U⊗V be the space of matrices M∈Fqa×b whose columns lie in U and whose rows lie in V. Then
dH(U⊗V)=dH(U)⋅dH(V),
and consequently, for every integer s≥1, dH(U⊗s)=dH(U)s.
Proof. We first give a basis of this matrix space. Let u1,…,uk and v1,…,vh be bases of U and V, and put P:=[u1⋯uk]∈Fqa×k and Q:=[v1⋯vh]∈Fqb×h. Choose left inverses L∈Fqk×a and J∈Fqh×b, so LP=Ik and JQ=Ih. If M∈U⊗V, its columns lie in U, so M=P(LM). Each row of LM is a linear combination of rows of M and therefore lies in V. Thus
M=PAQ⊺=i=1∑kj=1∑hAijuivj⊺forsomeA∈Fqk×h.
Conversely, every such matrix has columns in U and rows in V. Further,
PAQ⊺=0⟹L(PAQ⊺)J⊺=A=0.
Hence the matrices uivj⊤ form a basis and dimFq(U⊗V)=kh.
For the upper bound, choose minimum-weight nonzero u∈U and v∈V. Then uv⊤∈U⊗V, and
be its L-fold coordinate repetition, in which each coordinate is repeated L consecutive times. Then C(L) has length n0L, dimension k, and
dH(C(L))=L⋅dH(C).
Moreover, for every threshold t and every γ≥1, the map C↦C(L) with threshold Lt preserves the YES and NO alternatives for Hamming minimum distance at gap γ.
Proof. The Fq-linear repetition map and its left inverse are
C⟶C(L),c⟼c(L),C(L)⟶C,y⟼(y(i−1)L+1)i=1n0.
They are inverse isomorphisms, so dimFq(C(L))=dimFq(C)=k. Writing [⋅] for an indicator,
Taking the minimum over nonzero c∈C gives dH(C(L))=L⋅dH(C). Thus
dH(C)≤t⟹dH(C(L))≤Lt,dH(C)>γt⟹dH(C(L))>γLt.
□
3 A deterministic distance-preserving lift into the rank metric
Proof of Theorem 1.1.
Let C0≤FqN be a nonzero code of dimension k, and put d0:=dH(C0). The upper bound dR(Dα(C0)Fqm)≤d0 holds for every multiplier, so we need the reverse inequality for α=(1,ϑ,…,ϑN−1). The difficulty is that linear combinations over the extension field can have small rank. We will rule this out by showing that the lifted code has zero intersection with certain subspaces defined over Fq. We first prove this over Fq(t), bound the spread of a nonzero minor, and then substitute ϑ for t.
3.1 Rational subspaces
Fix a finite extension Fqm/Fq and an Fq-basis ξ1,…,ξm of Fqm. Every y∈FqmN has a unique expansion, and we define its rational subspace by
Lemma 3.1 (Rational subspaces). For every y∈FqmN, the subspace Rat(y) is independent of the chosen basis of Fqm. It is the smallest Fq-subspace U≤FqN with y∈UFqm, and dimFq(Rat(y))=wR(y). Consequently, for a nonzero code C0≤FqN with α∈(Fqm∗)N and an integer d, one has wR(y)<d for some nonzero y∈Dα(C0)Fqm if and only if Dα(C0)Fqm∩UFqm={0} for some subspace U≤FqN with dimFq(U)<d.
Proof of Lemma 3.1. Form the matrix (yi(a))a∈[m],i∈[N]∈Fqm×N, whose a-th row is y(a). The coordinate isomorphism
Fqm⟶Fqm,a=1∑mξaca⟼(c1,…,cm)⊺
sends yi to its i-th column. Thus its row space is Rat(y), and its column space is isomorphic to ⟨y1,…,yN⟩Fq. Equality of row and column rank gives
Thus a nonzero word of rank weight less than d exists in Dα(C0)Fqm if and only if Dα(C0)Fqm∩UFqm={0} for some U≤FqN with dimFq(U)<d, as required.
By Lemma 3.1, the required lower bound is equivalent to
We express the required zero intersection as a rank condition, or equivalently as the nonvanishing of a minor. This criterion applies both over Fq(t) and over Fqm. Let G∈FqN×k and B∈FqN×r have columns forming bases of C0 and U, respectively, where r:=dimFq(U). If r=0, then B is empty.
Lemma 3.2 (Intersection criterion). Let F be a field containing Fq and let D∈FN×N be an invertible diagonal matrix. Then, with C0 and U as above, D(C0)F∩UF={0}⟺rankF[DG∣B]=k+r, and this rank is full if and only if some (k+r)×(k+r) minor of [DG∣B] is nonzero.
By the Singleton bound, r<d0≤N−k+1, so r≤d0−1≤N−k and k+r≤N.
Proof of Lemma 3.2. Over F, the spaces D(C0)F and UF are the column spans of DG∈FN×k and B∈FN×r, respectively. Since D is invertible and the columns of G and B are independent, we have ker(DG)={0} and kerB={0}.
If 0=v∈D(C0)F∩UF, then
v=DGz=Bw,z∈Fk∖{0},w∈Fr,[DG∣B](−wz)=0.
This is a nontrivial dependence among the columns. Conversely, a nontrivial dependence has DGz=Bw with (z,w)=0. Then
z=0⟹Bw=0⟹w=0,
a contradiction. Thus z=0, and ker(DG)={0} gives 0=DGz=Bw∈D(C0)F∩UF.
We first prove that the intersection is zero over K:=Fq(t), with D(t):=diag(1,t,t2,…,tN−1).
Lemma 3.3 (Intersection over the function field). Let U≤FqN have dimension r<d0. Then D(t)(C0)K∩UK={0}, equivalently rankK[D(t)G∣B]=k+r.
Proof. Suppose that 0=y(t)∈D(t)(C0)K∩UK, and write y(t)=D(t)x(t), where 0=x(t)∈(C0)K. Fix Fq-bases c(1),…,c(k) of C0 and u(1),…,u(r) of U, and write
Choose 0=p(t)∈Fq[t] with p(t)λb(t),p(t)μb′(t)∈Fq[t] for all indices. Multiplying by p(t) keeps both vectors nonzero and in their respective spaces, and p(t)y(t)=D(t)(p(t)x(t)). Re-place x(t),y(t),λb(t),μb′(t) by their multiples by p(t), retaining the notation. Then x(t)=∑sx[s]ts and y(t)=∑sy[s]ts have finite support, with
The set S is finite, every h(t)∈W is supported on S, and Φ(yi(t))=Y∗,i. Thus kerΦ={0} and Φ(W) is the column space of Y. Since Ys,∗=y[s]∈U,
dimFq(W)=dimFq(Φ(W))=rankFqY≤dimFq(U)=r.
Select coordinates from left to right, putting T:={j∈[N]:yj(t)∈/⟨y1(t),…,yj−1(t)⟩Fq}, where the span of the empty set is {0}. At step j, a dependent yj(t) leaves the span unchanged; otherwise it extends the basis. Thus, by induction, {yi(t):i∈T∩[j]} is a basis of ⟨yi(t):i≤j⟩Fq, and ∣T∣=dimFq(W)≤r. For j∈/T, choose cj,i∈Fq such that
Define σ∗:=maxi:xi(t)=0degt(xi(t)). Every nonzero summand on the right has degree degt(cj,iti−jxi(t))=i−j+degt(xi(t))≤σ∗−1. Therefore [tσ∗]xj(t)=0 for j∈/T. The coefficient vector c:=x[σ∗]=([tσ∗]xi(t))i∈[N] satisfies
0=c∈C0,supp(c)⊆T⟹d0≤∥c∥0≤∣T∣≤r<d0,
a contradiction. Hence the intersection is zero, and Lemma 3.2 gives rankK[D(t)G∣B]=k+r. □
3.4 Degree spread of the maximal minors
By Lemma 3.3, for every U with r=dimFq(U)<d0 there is a row set R⊆[N],∣R∣=k+r, for which PR(t):=det([D(t)G∣B]R)=0. For a nonzero Laurent polynomial p(t), define spread(p(t)):=max{s:[ts]p(t)=0}−min{s:[ts]p(t)=0}.
Lemma 3.4 (Spread bound). Every nonzero maximal minor PR(t) of [D(t)G∣B] satisfies spread(PR(t))≤k(N−k).
Proof. Write R={r1<⋯<rk+r}. Expanding along the first k columns gives
where εR,S:=sgn(k(k+1)/2+∑ℓ:rℓ∈Sℓ), and the empty determinant is 1. For every such S, k(k−1)/2≤∑i∈S(i−1)≤k(2N−k−1)/2. Cancellation can only remove terms, so spread(PR(t))≤k(2N−k−1)/2−k(k−1)/2=k(N−k). □
3.5 Proof of Theorem 1.1
We now substitute ϑ for t and prove Theorem 1.1.
Proof of Theorem 1.1. By Lemma 3.1, it remains to show Dα(C0)Fqm∩UFqm={0} for every U≤FqN with r=dimFq(U)<d0. Fix such a U, with basis matrix B. By Lemmas 3.3 and 3.4, some row set R of size k+r gives PR(t)=0 with spread at most k(N−k). Write PR(t)=taQR(t), where a≥0, QR(t)∈Fq[t], and QR(0)=0. Then degt(QR(t))=spread(PR(t))≤k(N−k)<m. Since ϑ has degree m over Fq, we have QR(ϑ)=0. Also ϑ=0 and D(ϑ)=Dα, so
By Lemma 3.2, Dα(C0)Fqm∩UFqm={0}. Since U was arbitrary, Lemma 3.1 and the upper bound from Section 2 give d0≤dR(Dα(C0)Fqm)≤d0.
3.6 Repetition and the extension degree
Repetition lowers the exponent in the extension-degree bound. We also require m≥κN1, so that the same field can support the auxiliary code used for rate calibration.
Lemma 3.5 (Repetition before lifting). Fix q,ε>0, and a constant κ≥1. Let B:=max{1,⌈1/ε⌉} be an integer. Given a nonzero code C≤Fqn0 of dimension k, put
L:=n0B−1,N1:=n0B,m:=max{2,k(N1−k)+1,⌈κN1⌉}.
One can construct deterministically an Fqm-linear code C≤FqmN1 such that dimFqm(C)=k, dR(C)=L⋅dH(C), m=Oκ,ε(N11+ε). The construction is polynomial time for fixed q,κ,ε.
Proof. Repeat each coordinate of C exactly L times to obtain C(L). Construct Fqm and an element ϑ of degree m over Fq by Lemma 2.1. Our choice of degree gives m≥2, m>k(N1−k), and m≥κN1; in particular, ϑ=0. Define α:=(1,ϑ,…,ϑN1−1) and C:=Dα(C(L))Fqm. Since Dα is invertible, scalar extension and Theorem 1.1 give dimFqm(C)=dimFq(C(L))=k, dR(C)=dH(C(L))=L⋅dH(C). Finally,
k≤n0=N11/B,B1≤ε⟹m=Oκ(N11+1/B)=Oκ,ε(N11+ε).
The generator matrix uses O(kN1m⋅logq) bits, which is bounded by a polynomial in n0 for fixed q,κ,ε. Coordinate repetition, finite-field construction, and diagonal scaling all take polynomial time. □
4 Exact rate calibration
We now change the rate while preserving minimum distance and the minimum weight in a given affine space. Throughout this section, we work over Fqm with rank weight over Fq.
Lemma 4.1 (Auxiliary codes). Fix q and a rational R∈(0,1). For integers n≥1 and 0≤k≤n, one can construct a nonzero code D≤Fqmℓ of dimension h satisfying dR(D)≥n, k+h≥R(n+ℓ), and ℓ=OR(n). The constants depend only on R, and the construction requires m≥κRn for a constant κR≥1. The construction is deterministic and polynomial time in its input and output sizes.
The condition dR(D)≥n ensures that adjoining D does not lower the input distance. The inequality k+h≥R(n+ℓ) ensures that the number of zero coordinates added below is nonnegative.
Proof of Lemma 4.1. Put σ:=(1+R)/2 and Δ:=1−σ, and put
M:=⌈max{Δn,σ−R(Rn−k)+,1}⌉,(x)+:=max{x,0}.
Set ℓ:=M. For
κR:=1+max{(1−σ)−1,R/(σ−R),1},
we have ℓ≤κRn≤m. Thus Lemma 4.4 gives a Gabidulin code D with h:=⌈σℓ⌉ and
dR(D)=ℓ−h+1=ℓ−⌈σℓ⌉+1≥(1−σ)ℓ≥n.
Then D=0, ℓ=O(n), and
k+h−R(n+ℓ)≥k−Rn+(σ−R)ℓ≥0.
The construction and its running time follow from Lemma 4.4.
Lemma 4.2 (Rate calibration for linear codes and affine spaces). Fix q and a rational R=a/b∈(0,1) in lowest terms. Given C≤Fqmn, where n≥1, there is a deterministic construction of a nonzero code W≤FqmN such that
Given additionally u+C⊆Fqmn, the same construction produces u♯+W with μR(u♯+W)=μR(u+C). Here c=cR, and the construction requires m≥κRn. Thresholds are unchanged. If T≥θn and either C=0 or dR(C)≥ηn, where 0<η≤1, then T≥(θ/c)N and dR(W)≥(η/c)N.
Proof. Set k:=dimFqm(C), and choose D by Lemma 4.1. Put U:=C⊕D, nU:=n+ℓ, kU:=k+h, z:=bkU−anU, and W:=U⊕a⊕0z. Since kU≥RnU, we have z∈Z≥0, and
For rank weight, wR(x,y)≥max{wR(x),wR(y)} and wR(x,0)=wR(x). Indeed, ⟨x1,…,xn⟩Fq⊆⟨x1,…,xn,y1,…,yℓ⟩Fq, and the same holds for y. Thus, for nonzero component codes, dR(C⊕D)=min{dR(C),dR(D)}: the lower bound follows by projection, and (x,0) or (0,y), with x or y of minimum weight, attains it. Therefore
Define u♯:=(u,0ℓ,0(a−1)nU,0z)∈FqmN. Only the first copy is translated: u♯+W=((u+C)⊕D)⊕U⊕(a−1)⊕0z. Projection onto the first n coordinates gives wR(y)≥μR(u+C) for every y∈u♯+W. Choose x∗∈u+C with wR(x∗)=μR(u+C). Since (x∗,0N−n)∈u♯+W,
Finally, dR(W)≥ηn≥(η/c)N. For θ>0, T≥θn≥(θ/c)N; for θ≤0, the threshold bound follows from T≥0. All operations use explicit linear algebra and direct sums. □
Corollary 4.3 (Exact-rate Hamming-to-rank reduction). Fix q, a rational R∈(0,1), and ε>0. Given a nonzero C≤Fqn0 and a threshold t, the preceding constructions produce, in deterministic polynomial time, a rank instance (W,T) over Fqm with
where L=n0B−1 and N1=n0B as in Lemma 3.5. If dH(C)≥η0n0 and t≥θ0n0, then dR(W)≥(η0/cR)N and T≥(θ0/cR)N.
Proof. Apply Lemma 3.5 with κ=κR. It gives distance L⋅dH(C) and m≥κRN1, so Lemma 4.2 applies over the same field with input length N1. Keeping T:=Lt, we obtain dR(W)=L⋅dH(C), N1≤N≤cRN1, and m=OR,ε(N11+ε)=OR,ε(N1+ε). Since Ln0=N1, for positive η0 and θ0, respectively,
A nonpositive constant gives the corresponding bound directly from dR(W),T≥0.
4.1 Deterministic Gabidulin codes
To change the rate of a nonzero code C≤Fqmn, we need an auxiliary code whose distance is at least dR(C). Since rank weight is at most n, Lemmas 2.4 and 2.6 give
For an r-dimensional subspace W≤Fqm, define AW(X):=∏w∈W(X−w). We verify that it is linearized of q-degree r. The base case is A{0}(X)=X. Suppose the assertion holds for W, and choose u∈/W. Then AW(u)=0, and
The last polynomial is monic and linearized, of q-degree r+1. Induction proves the assertion. Its roots are exactly W, and any monic polynomial of degree qr vanishing on all qr elements of W equals this product. Thus AW(X) is the unique monic linearized polynomial of q-degree r with kernel W.
If f(X) and g(X) have q-degrees s and r, with leading coefficients as,br=0, then g(f(X)) is linearized and
Lemma 4.4 (Explicit Gabidulin code). Let 1≤ℓ≤m. For every integer h with 1≤h≤ℓ, one can construct deterministically, in time polynomial in m, ℓ, and logq, an Fqm-linear code D≤Fqmℓ with
dimFqm(D)=h,dR(D)=ℓ−h+1.
Proof. Choose Fq-linearly independent g1,…,gℓ∈Fqm. In a polynomial basis Fqm=Fq[ϑ], take gi:=ϑi−1; in any explicit representation, take the first ℓ vectors of a known Fq-basis. This is possible because ℓ≤m. Define D as the image of the Fqm-linear evaluation map
This contradiction proves wR(y)≥ℓ−h+1 for every nonzero codeword.
For the matching upper bound, rank weight is at most Hamming weight over Fqm, by Lemma 2.4, and the Hamming Singleton bound gives
ℓ−h+1≤dR(D)≤dH(D)≤ℓ−h+1.
The generator has hℓ entries in Fqm, each represented by O(m⋅logq) bits. Computing its successive Frobenius powers and the evaluation basis takes time polynomial in m,ℓ,logq. □
5 The Hamming source
We need both ordinary and distinguished-coordinate Hamming instances in which every nonzero word has weight proportional to the length, and the YES and NO cases have separated weight bounds. We use the balanced-code construction and the distinguished coordinate of [BGR25]. The quadratic reduction and the balanced map are stated in Proposition 5.3 and Lemma 5.4. The following weight bound gives the required separation.
Lemma 5.1 (Weight separation). Let D>0 and ε≥0, and let G:Fqp→FqM be an injective linear map, represented by G∈FqM×p, with D≤∥Gx∥0≤(1+ε)D for every x=0. Then ∥GXG⊤∥0≥D2 for every nonzero X∈Fqp×p. If rankX=1, this weight is at most (1+ε)2D2; if rankX≥2, it is at least (1+1/q)D2.
Proof. Put U:=G(Fqp) and d:=dH(U)≥D. For linearly independent u,v∈U, each coordinate in supp(u)∪supp(v) is nonzero in exactly q2−q of the q2−1 words au+bv, (a,b)∈Fq2∖{(0,0)}. Every such word has weight at least d, so
Put Y:=GXG⊤. Its columns and transposed rows lie in U. Choose a left inverse P∈Fqp×M of G. Then PG=Ip, X=PYP⊤, rankX≤rankY≤rankX. If Y∗,j=0, every row indexed by supp(Y∗,j) is nonzero, and hence
∥Y∥0=i∑∥Yi,∗∥0≥d∣supp(Y∗,j)∣≥d2≥D2.
If rankY≥2, choose two independent columns Y∗,j,Y∗,k. The same row sum gives
Finally, if rankX=1, write X=uv⊤ with nonzero u,v∈Fqp. Then Y=(Gu)(Gv)⊤, and ∥Y∥0=∥Gu∥0∥Gv∥0≤(1+ε)2D2.
Lemma 5.2 (Ordinary and distinguished-coordinate sources). Fix a prime power q and a rational Λ>1. There are deterministic polynomial-time reductions from 3SAT of the following two forms, with positive constants depending only on q,Λ.
The ordinary reduction outputs a nonzero code C≤Fqno and an integer To with dH(C)≥ηono and θono≤To≤no. In the YES case dH(C)≤To; in the NO case dH(C)>ΛTo.
The distinguished-coordinate reduction outputs V≤Fqnm, a coordinate j, and an integer Tm with θmnm≤Tm≤nm, and ∥v∥0≥ηmnm for every v∈V∖{0}. In the YES case there is v∈V with vj=1 and ∥v∥0≤Tm; in the NO case ∥v∥0>ΛTm for every v∈V∖{0}. The code V may be zero in the NO case.
The lengths and constants of the two reductions need not coincide.
Proof. By Proposition 5.3, reduce 3SAT to equations Qi(ww⊤)=0 over Fq, where the Qi are linear forms on p×p matrices. In the YES case there is a solution with wz=1; in the NO case there is no nonzero solution.
Set ξq:=1/(18q), εq:=1/(9q), δq:=(1−ξq)(1−1/q), Aq:=1+1/(3q), and Bq:=1+1/q. By Lemma 5.4, construct G:Fqp→FqM with D:=δqM and D≤∥Gx∥0≤(1+εq)D for x=0. Here M is bounded by a polynomial in p and tends to infinity with p. Also, (1+εq)2≤Aq<Bq.
Solve the linear system defining S:={X∈Fqp×p:X=X⊤,Qi(X)=0 for all i}. Reading a matrix row by row as a vector of length M2, form the image codes V0:=ϕ0(S) and V1:=ϕ1(S) of the maps
ϕ0:S⟶FqM2,X⟼GXGT,ϕ1:S⟶FqM2+1,X⟼(GXGT,Xzz).
Both maps are injective, since X=P(GXG⊤)P⊤ for a left inverse P of G. By Lemma 5.1, ∥ϕb(X)∥0≥D2 for b∈{0,1} and X∈S∖{0}.
In a YES instance, choose a solution w with wz=1. Then X:=ww⊤∈S, Xzz=1, ∥ϕ0(X)∥0≤AqD2, and ∥ϕ1(X)∥0≤AqD2+1.
In a NO instance, a nonzero rank-one X∈S would satisfy X=uv⊤=vu⊤ for nonzero u,v∈Fqp. Symmetry gives v=λu for some λ=0, since ⟨u⟩Fq=colX=colX⊤=⟨v⟩Fq, and hence 0=Qi(X)=λQi(uu⊤)⟹Qi(uu⊤)=0 for all i, contradicting the quadratic NO case. Thus X∈S∖{0} implies rankX≥2, and ∥ϕb(X)∥0≥BqD2 for b∈{0,1}.
Choose a fixed integer a≥1 with (Bq/Aq)a>Λ. For b∈{0,1}, put
If Vb=0, then Wb=0, and there are no nonzero words to consider. Otherwise, minimum distance multiplies under tensor products by Lemma 2.7. Thus, for every 0=v∈Wb,
∥v∥0≥D2a,andinaNOinstance,∥v∥0≥(BqD2)a.
In a YES instance, the previously constructed witness vb∈Vb satisfies
∥vb⊗a∥0=∥vb∥0a≤min{ℓb,(AqD2+b)a}≤tb.
For b=1, its distinguished tensor coordinate satisfies (v1⊗a)(M2+1,…,M2+1)=1a=1.
Since D→∞ with p, we have
(AqD2+1)a+1(BqD2)a⟶(Bq/Aq)a>Λ.
Hence, for all sufficiently large p,
(BqD2)a>Λ((AqD2+1)a+1)≥Λtb.
The length and threshold satisfy
δq2aM2a=D2a≤tb≤ℓb≤2aM2a.
The distinguished-coordinate output is V:=W1,nm:=ℓ1,Tm:=t1, with distinguished coordinate (M2+1,…,M2+1) and ηm=θm:=δq2a/2a.
For the ordinary output, put
h:=⌊Λt0⌋+1,C:=W0⊕Reph,no:=ℓ0+h,To:=t0,
where Reph:={λ1h:λ∈Fq}. This code is nonzero even when W0=0. With the convention dH(0)=+∞,
dH(C)=min{dH(W0),h},h>Λt0≥D2a.
The YES witness lies in W0⊕0h, so dH(C)≤t0 in the YES case. In the NO case both entries of the minimum exceed Λt0. In either case dH(C)≥D2a. Moreover,
For the bounded values of p excluded above, decide the quadratic system by exhaustive search. The ordinary reduction outputs
(C,To):={(Rep1,1),(Rep⌊Λ⌋+1,1),onYES,onNO.
These outputs have relative distance 1, and the ratio of threshold to length is at least (⌊Λ⌋+1)−1. Their distances are 1≤To and ⌊Λ⌋+1>ΛTo, respectively. The distinguished-coordinate reduction outputs
(V,j,Tm):={(Fq,1,1),({0},1,1),onYES,onNO.
The YES word is 1, the NO code has no nonzero word, and both thresholds equal their length. Decrease the constants ηo,θo,ηm,θm, if necessary, to include these outputs. All thresholds are computed from D, not from minimum distances. Linear algebra, the balanced map, and the fixed tensor power take polynomial time.
5.1 Imported ingredients
The following proposition is [BGR25, Proposition 5], applied after translating a 3SAT formula into a Boolean circuit.
Proposition 5.3 (Homogeneous quadratic equations). For every fixed finite field Fq, there is a deterministic polynomial-time reduction from 3SAT to linear forms Q1,…,Qℓ on Fqp×p and a distinguished coordinate z∈[p] such that:
• (YES) there is w∈Fqp with wz=1 and Qi(ww⊤)=0 for every i∈[ℓ];
• (NO) there is no nonzero w∈Fqp with Qi(ww⊤)=0 for every i∈[ℓ].
We also use the explicit construction in [BGR25, Lemma 11]. The bound D is known from the output length, so we can compute the thresholds above without computing a minimum distance.
Lemma 5.4 (Explicit balanced map). For every fixed prime power q, every fixed rational ξ∈(0,1/2), and every input dimension n≥1, there is a deterministic polynomial-time construction of a linear map G:Fqn→FqN and a computable rational number
D:=(1−ξ)(1−q1)N
such that N≤(qn/ξ)2 and every nonzero x∈Fqn satisfies
D≤∥Gx∥0≤(1−q1)N≤(1+2ξ)D.
In particular, G is injective.
6 Deterministic rank-metric hardness
Proof of Theorem 1.2, Theorem 1.3
We now combine the Hamming reductions, the distance-preserving lift, and the rate calibration to prove the two hardness results.
Proof of Theorems 1.2 and 1.3. Fix a rational R∈(0,1), choose a rational Λ>Γ, and let η0,θ0 be the smaller constants in the two outputs of Lemma 5.2. For minimum distance, apply Corollary 4.3 to the ordinary output (C,t). It gives dR(W)=L⋅dH(C) and T=Lt, so dH(C)≤t⟹dR(W)≤T and dH(C)>Λt⟹dR(W)>ΛT>ΓT. Also rate(W)=R, dR(W)≥(η0/cR)N, T≥(θ0/cR)N, and m=OR,ε(N1+ε).
For decoding, take the distinguished-coordinate source (V,j,t) of length n0. For a basis v1,…,vk of V, Gaussian elimination tests whether ∑i=1kλi(vi)j=1 has a solution (λ1,…,λk)∈Fqk, equivalently whether the slice {v∈V:vj=1} is nonempty. Suppose first that it is nonempty, so V=0.
Apply Lemma 3.5 with κ=κR to obtain V=Dα(V(L))Fqm≤FqmN1. Let j⋆ be one of the repeated copies of j, and put A:={x∈V:xj⋆=αj⋆}, C0:={x∈V:xj⋆=0}, and T:=Lt. Choose any v0∈V with (v0)j=1, and put x0:=Dα(v0(L)). Then (x0)j⋆=αj⋆ and A=x0+C0.
In a YES instance, choose the witness v∈V with vj=1 and ∥v∥0≤t. Since every αi=0, its image belongs to A and satisfies
wR(Dα(v(L)))≤∥Dα(v(L))∥0=L∥v∥0≤Lt=T.
In a NO instance, every x∈A has xj⋆=αj⋆=0, and hence
wR(x)≥dR(V)=L⋅dH(V)>ΛLt=ΛT.
Further, for every x∈C0∖{0}, wR(x)≥dR(V)≥Lη0n0=η0N1. Since m≥κRN1, apply Lemma 4.2 to A, retaining threshold T. If C0=0, its zero-code case gives dR(W)≥N1≥η0N1; otherwise its distance formula gives the same lower bound. Thus
If {v∈V:vj=1} is empty, the source instance is NO. Fix an integer D>Γ and a degree m∗≥max{2,D,⌈κRD⌉}. Choose a1,…,aD∈Fqm∗ linearly independent over Fq. For a:=(a1,…,aD), wR(a)=dimFq(⟨a1,…,aD⟩)=D>Γ. Calibrate {a}=a+0 with threshold 1, obtaining a fixed output u∗+W∗⊆Fqm∗N∗ with μR(u∗+W∗)=D, rate(W∗)=R, and dR(W∗)≥D.
Take η:=min{η0/cR,D/N∗}>0 and θ:=min{θ0/cR,1/N∗}>0. If the nonempty branch has degree bound m≤cdegN1+ε, replace cdeg by max{cdeg,m∗} to cover the fixed output.
Finally, for any output u+W⊆FqmN, the nearest-codeword instance (W,u,T) has optimum dist(u,W)=μR(u+W). Compute a full-row-rank parity-check matrix H∈Fqm(N−dimFqm(W))×N with kerH=W, and put s:=Hu⊤. Then
{e∈FqmN:He⊤=s}=u+W,{e∈FqmN:He⊤=0}=W.
Thus the syndrome instance is consistent and has the same optimum and kernel as the affine instance.
Field construction, elimination, repetition, lifting, and calibration all take deterministic polynomial time for the fixed parameters, by Lemmas 2.1, 3.5 and 4.2. The constants η,θ>0 depend only on q,R,Γ. □
References
[AB+97] Sanjeev Arora, László Babai, Jacques Stern, and Z Sweedyk. "The Hardness of Approximate Optima in Lattices, Codes, and Systems of Linear Equations". In: Journal of Computer and System Sciences 54.2 (1997), pp. 317–331 (cit. on p. 6).
[AK11] Per Austrin and Subhash Khot. "A simple deterministic reduction for the gap minimum distance of code problem". In: Proceedings of the 38th International Colloquium Conference on Automata, Languages and Programming - Volume Part I. ICALP'11. Zurich, Switzerland: Springer-Verlag, 2011, pp. 474–485 (cit. on pp. 2–4, 6).
[BB+20a] Magali Bardet, Pierre Briaud, Maxime Bros, Philippe Gaborit, Vincent Neiger, Olivier Ruatta, and Jean-Pierre Tillich. "An Algebraic Attack on Rank Metric Code-Based Cryptosystems". In: Advances in Cryptology – EUROCRYPT 2020. Lecture Notes in Computer Science. arXiv:1910.00810. Springer, 2020 (cit. on p. 7).
[BB+20b] Magali Bardet, Maxime Bros, Daniel Cabarcas, Philippe Gaborit, Ray Perlner, Daniel Smith-Tone, Jean-Pierre Tillich, and Javier Verbel. "Improvements of Algebraic Attacks for Solving the Rank Decoding and MinRank Problems". In: Advances in Cryptology – ASIACRYPT 2020. Lecture Notes in Computer Science. Springer, 2020 (cit. on p. 7).
[BFS99] Jonathan F. Buss, Gudmund S. Frandsen, and Jeffrey O. Shallit. "The Computational Complexity of Some Problems of Linear Algebra". In: Journal of Computer and System Sciences 58.3 (1999), pp. 572–596 (cit. on pp. 2, 6).
[BG+25] Vijay Bhattiprolu, Venkatesan Guruswami, Euiwoong Lee, and Xuandi Ren. "Inapproximability of Finding Sparse Vectors in Codes, Subspaces, and Lattices". In: 2025 IEEE 66th Annual Symposium on Foundations of Computer Science (FOCS). 2025, pp. 1295–1303 (cit. on p. 6).
[BGR25] Vijay Bhattiprolu, Venkatesan Guruswami, and Xuandi Ren. "PCP-free APX-hardness of nearest codeword and minimum distance". In: arXiv Preprint (2025) (cit. on pp. 2–7, 20, 23).
[BMT78] Elwyn R. Berlekamp, Robert J. McEliece, and Henk C. A. van Tilborg. "On the Inherent Intractability of Certain Coding Problems". In: IEEE Transactions on Information Theory 24.3 (1978), pp. 384–386 (cit. on pp. 2, 6).
[BR+22] Sebastian Bitzer, Julian Renner, Antonia Wachter-Zeh, and Violetta Weger. Generic Decoding in the Cover Metric. arXiv:2205.12738. 2022 (cit. on p. 5).
[Cou01] Nicolas T. Courtois. "Efficient zero-knowledge authentication based on a linear algebra problem MinRank". In: Advances in Cryptology, ASIACRYPT 2001. Vol. 2248. Lecture Notes in Computer Science. Springer, 2001, pp. 402–421 (cit. on pp. 2, 6).
[CW12] Qi Cheng and Daqing Wan. "A Deterministic Reduction for the Gap Minimum Distance Problem". In: IEEE Transactions on Information Theory 58.11 (2012), pp. 6935–6941 (cit. on pp. 2, 6).
[Del78] Philippe Delsarte. "Bilinear forms over a finite field, with applications to coding theory". In: Journal of Combinatorial Theory, Series A 25.3 (1978), pp. 226–241 (cit. on pp. 2, 6).
[DMS03] I. Dumer, D. Micciancio, and M. Sudan. "Hardness of approximating the minimum distance of a linear code". In: IEEE Transactions on Information Theory 49.1 (2003), pp. 22–37 (cit. on pp. 2, 6).
[Gab26] Philippe Gaborit. "Maximum-Likelihood Decoding of Gabidulin Codes Is NP-Hard Even in Dimension One". In: arXiv Preprint 2610.34404 (2026) (cit. on p. 5).
[Gab85] É. M. Gabidulin. "Theory of Codes with Maximum Rank Distance". In: Probl. Peredachi Inf. 21.1 (1985), pp. 3–16 (cit. on pp. 2, 6). "Theory of Codes with Maximum Rank Distance". In: Problems Inform. Transmission 21.1 (1985), pp. 1–12.
[GM+99] Oded Goldreich, Daniele Micciancio, Shmuel Safra, and Jean-Pierre Seifert. "Approximating Shortest Lattice Vectors is not Harder than Approximating Closest Lattice Vectors". In: Information Processing Letters 71.2 (1999), pp. 55–61 (cit. on p. 5).
[GZ16] Philippe Gaborit and Gilles Zémor. "On the Hardness of the Decoding and the Minimum Distance Problems for Rank Codes". In: IEEE Transactions on Information Theory 62.12 (2016), pp. 7245–7252 (cit. on pp. 2–6, 8).
[Kan87] Ravi Kannan. "Minkowski's Convex Body Theorem and Integer Programming". In: Mathematics of Operations Research 12.3 (1987), pp. 415–440 (cit. on p. 5).
[KK21] Hervé Tale Kalachi and Hermann Tchatchiem Kamche. On the Rank Decoding Problem over Finite Principal Ideal Rings. arXiv:2106.11569. 2021 (cit. on p. 6).
[Mic14] Daniele Micciancio. "Locally Dense Codes". In: Proceedings of the 29th IEEE Conference on Computational Complexity (CCC). ECCC TR13-115. 2014, pp. 90–97 (cit. on p. 6).
[PRR22] Sven Puchinger, Julian Renner, and Johan Rosenkilde. "Generic Decoding in the Sum-Rank Metric". In: IEEE Transactions on Information Theory (2022). arXiv:2001.04812 (cit. on p. 6).
[Rot91] Ron M. Roth. "Maximum-Rank Array Codes and their Application to Crisscross Error Correction". In: IEEE Transactions on Information Theory 37.2 (1991), pp. 328–336 (cit. on p. 6).
[Sho90] Victor Shoup. "New Algorithms for Finding Irreducible Polynomials Over Finite Fields". In: Mathematics of Computation 54.189 (1990), pp. 435–447 (cit. on p. 7).
[Var97] A. Vardy. "The intractability of computing the minimum distance of a code". In: IEEE Transactions on Information Theory 43.6 (1997), pp. 1757–1766 (cit. on pp. 2, 6).