---
title: Irregular Lee Distance Codes
url: https://www.emergentmind.com/topics/irregular-lee-distance-codes
type: topic
---

# Irregular Lee Distance Codes

Irregular Lee distance codes are code families in Lee-metric spaces for which uniform pairwise separation, perfect tiling structure, or homogeneous algebraic behavior is relaxed or absent. In the cited literature, the phrase does not denote a single universally fixed class. It can refer to arbitrary codes \(C\subseteq \mathbb{Z}_q^n\) with no linearity or regularity assumption, to explicitly defined \(\mathbf{D}\)-irregular-Lee-distance codes whose pairwise lower bounds are prescribed by a matrix, and to non-perfect, non-periodic, non-free, or heterogeneous Lee-metric constructions that arise when perfect Lee sphere tilings fail or when coordinate behavior varies across a ring-filtration or weight-spectrum hierarchy [1810.05066], [2508.01702], [1701.08412].

## 1. Formal setting and meanings of irregularity

The Lee metric on \((\mathbb{Z}/q\mathbb{Z})^n\) is
\[
d_L(x,y)=\sum_{i=1}^{n}\min\{|x_i-y_i|,\;q-|x_i-y_i|\},
\]
and on \(\mathbb{Z}^n\) it becomes the \(L^1\) metric
\[
d_L(x,y)=\sum_{i=1}^n |x_i-y_i|.
\]
A code in the Lee metric is any subset \(C\subseteq \mathbb{Z}_q^n\), and no linearity or regularity is assumed in the general definition. The extremal size parameter is
\[
A_q^L(n,d)=\max\{|C|: C\subseteq \mathbb{Z}_q^n,\ d_{\min}(C)\ge d\},
\]
with \(d_{\min}(C)\) the minimum Lee distance of \(C\) [1810.05066].

Several distinct notions of “irregularity” appear in the literature.

| Sense | Formal object | Source |
|---|---|---|
| Arbitrary Lee code | Any \(C\subseteq \mathbb{Z}_q^n\) | [1810.05066] |
| Distance-matrix irregularity | \(\mathbf{D}_L\)-code with \(d_L(\mathbf{p}_i,\mathbf{p}_j)\ge [\mathbf{D}]_{ij}\) | [2508.01702] |
| Non-perfect/non-tiling behavior | Codes without perfect Lee sphere tilings | [1701.08412], [1804.09290] |
| Ring-theoretic heterogeneity | Non-free codes, support subtypes, filtration layers | [2112.06635], [2307.06079] |
| Weight-spectrum irregularity | Many distinct Lee weights or non-few-weight behavior over \(\mathbb{Z}_4\) | [2502.10697] |

The explicit distance-matrix notion is the most formal. A set \(\mathcal{P}=\{\mathbf{p}_1,\dots,\mathbf{p}_M\}\subseteq \mathbb{Z}_q^r\) is a \(\mathbf{D}\)-irregular-Lee-distance code if there exists an ordering such that
\[
d_L(\mathbf{p}_i,\mathbf{p}_j)\ge [\mathbf{D}]_{ij}\qquad \forall i,j\in[M],
\]
and the minimum feasible length is denoted \(N_L(\mathbf{D})\) [2508.01702]. When \([\mathbf{D}]_{ij}=D\) for all \(i\neq j\), this reduces to the usual regular-distance shortest-length problem \(N_L(M,D)\).

A different but complementary use of “irregular” arises in \(\mathbb{Z}_4\)-linear constructions. There the focus is not on pair-specific minimum distances but on non-uniform or highly constrained Lee weight distributions. For odd \(m\), some defining-set constructions produce 3-weight or otherwise controlled multi-weight Lee codes, whereas for even \(m\) the same constructions produce many more distinct Lee weights and are described as “performing worse,” with full weight distributions left undetermined [2502.10697].

## 2. Perfect tilings, nonexistence, and why irregularity becomes necessary

Perfect Lee codes are the regular benchmark against which irregularity is often measured. In \((\mathbb{Z}/q\mathbb{Z})^n\), a perfect \(e\)-error-correcting Lee code is a subset \(C\) such that every vector lies within Lee distance at most \(e\) from a unique codeword. In \(\mathbb{Z}^n\), this is equivalent to a translational tiling by Lee spheres \(S(n,e)\). For \(q\ge 2e+1\), there is a natural bijection between \(PL(n,e,q)\)-codes and \(PL(n,e)\)-codes that are unions of cosets of \(q\mathbb{Z}^n\), so perfect Lee codes are exactly translational tilings of \(\mathbb{Z}^n\) by Lee spheres, up to periodicity mod \(q\) [1701.08412].

The central obstruction is the Golomb–Welch conjecture: for \(n\ge 3\) and \(e\ge 2\), there exist no \(PL(n,e)\)-codes. For \(e=2\), the Lee sphere size is
\[
|S(n,2)|=2n^2+2n+1.
\]
A number-theoretic nonexistence theorem proves that if \(p=2n^2+2n+1\) is prime, \(a\) is the least positive integer with \(p\mid 4^a+4n+2\), \(b\) is the least positive integer with \(p\mid 4^b-1\), and the Diophantine equation
\[
a(x+1)+by=n,\qquad x,y\in\mathbb{Z}_{\ge 0}
\]
has no solution, then no \(PL(n,2)\)-code exists. This excludes, for example,
\[
n=5,7,9,12,14,17,\ldots
\]
and is expected to apply to infinitely many dimensions if there are infinitely many primes of the form \(2n^2+2n+1\) [1701.08412].

For linear perfect 2-error-correcting Lee codes, the obstruction is stronger. Let
\[
\mathcal{N}=\{n\ge 3:\text{there are no linear }PL(n,2)\text{-codes}\}.
\]
One result shows that
\[
n\equiv 8,13,18,23 \pmod{25}
\]
implies \(\mathrm{LPL}(n,2)=\emptyset\), hence
\[
\underline{d}(\mathcal{N})\ge \frac{4}{25}
\quad\text{and}\quad
\#\{n\in\mathcal{N}:n\le x\}\ge \frac{4x}{25}(1+o(1)).
\]
Thus a positive lower density of dimensions forbid linear perfect 2-error-correcting Lee codes [1804.09290].

A further algebraic treatment via group rings and characters proves nonexistence of linear perfect Lee codes of radii \(2\) and \(3\) for infinitely many dimensions, and for radius \(2\) it excludes all \(3\le n\le 100\) except
\[
n=16,21,36,55,64,66,78,92.
\]
This is obtained by translating the perfect tiling condition into group-ring identities such as
\[
T^2=2G-T^{(2)}+2n
\]
for radius \(2\), then deriving contradictions via character values, finite-field reductions, and arithmetic conditions on prime divisors of \(2n^2+2n+1\) [1802.04608].

These results do not directly address nonlinear perfect Lee codes. In particular, the positive-density nonexistence argument for linear \(PL(n,2)\)-codes uses quotient groups and homomorphisms, and there is no immediate analogue for a general nonlinear code [1804.09290]. This clarifies a common misconception: linear nonexistence strengthens the Golomb–Welch picture but does not settle the nonlinear case. Still, the cumulative effect is clear. In many parameter regimes, perfect regular tilings are impossible, so any high-performance Lee code must be non-perfect, non-lattice, non-periodic, or otherwise irregular.

## 3. Distance-matrix irregularity and function-correcting Lee codes

The most explicit modern formalization of irregular Lee-distance coding appears in the theory of function-correcting Lee codes (FCLCs). Here one does not need uniform separation between all message pairs. One only needs enough separation to recover a function value \(f(\mathbf{u})\) from a Lee-corrupted systematic encoding \(\mathrm{Enc}(\mathbf{u})=(\mathbf{u},p(\mathbf{u}))\) when at most \(t\) Lee errors occur [2508.01702].

For a function \(f:\mathbb{Z}_q^k\to \mathrm{Im}(f)\), the distance requirement matrix on a message set \(\{\mathbf{u}_1,\dots,\mathbf{u}_M\}\) is
\[
[\mathbf{D}_f(t,\mathbf{u}_1,\dots,\mathbf{u}_M)]_{ij}
=
\begin{cases}
[2t+1-d_L(\mathbf{u}_i,\mathbf{u}_j)]^+,& f(\mathbf{u}_i)\neq f(\mathbf{u}_j),\\
0,& \text{otherwise},
\end{cases}
\]
where \([x]^+=\max\{x,0\}\). The optimal redundancy is exactly the shortest length of an irregular Lee-distance code with this matrix:
\[
r_L^f(q,k,t)=N_L\big(\mathbf{D}_f(t,\mathbf{u}_1,\dots,\mathbf{u}_{q^k})\big).
\]
This identity shows that irregular Lee-distance coding is not merely a relaxation of classical minimum-distance coding; it is the natural geometry of function protection under Lee-metric channels [2508.01702].

A reduced description replaces the full \(q^k\times q^k\) matrix by a function-distance matrix on \(\mathrm{Im}(f)\). For function values \(f_1,f_2\),
\[
d_L^f(f_1,f_2)
=
\min_{\mathbf{u}_1,\mathbf{u}_2}
d_L(\mathbf{u}_1,\mathbf{u}_2)
\quad
\text{s.t. }
f(\mathbf{u}_1)=f_1,\ f(\mathbf{u}_2)=f_2,
\]
and then
\[
[\mathbf{D}_f(t,f_1,\dots,f_E)]_{ij}
=
\begin{cases}
[2t+1-d_L^f(f_i,f_j)]^+,& i\neq j,\\
0,& i=j.
\end{cases}
\]
This yields
\[
r_L^f(q,k,t)\le N_L(\mathbf{D}_f(t,f_1,\dots,f_E)),
\]
with equality when representatives realizing all pairwise function distances exist [2508.01702].

The paper also proves a Plotkin-like lower bound for irregular Lee-distance codes. If \(\mathbf{D}\in\mathbb{N}_0^{M\times M}\), then \(N_L(\mathbf{D})\) is bounded below by a multiple of \(\sum_{i<j}[\mathbf{D}]_{ij}\), with four cases depending on the parity of \(q\) and \(M\). For example, when \(q\) is even and \(M\) is even,
\[
N_L(\mathbf{D}) \ge \frac{8}{M^2 q}\sum_{i<j}[\mathbf{D}]_{ij}.
\]
For odd \(q\), the extremal per-coordinate pairwise Lee-distance distribution is not the same as in the even case, and the refined bound corrects earlier Lee Plotkin-like arguments that treated both parities uniformly [2508.01702].

This framework becomes explicit for several function classes. For the Lee weight function \(f(\mathbf{u})=\mathrm{wt}_L(\mathbf{u})\), the induced function-distance matrix has entries
\[
[\mathbf{D}_{\mathrm{wt}_L}(E,t)]_{ij}
=
\begin{cases}
0,& i=j,\\
[2t+1-|i-j|]^+,& i\neq j,
\end{cases}
\]
and the optimal redundancy is exactly \(N_L(\mathbf{D}_{\mathrm{wt}_L}(E,t))\). For the modular sum \(f(\mathbf{u})=\sum_i u_i \pmod q\), a suitable set of representatives again makes the reduced matrix exact, so
\[
r_L^{\mathrm{ms}}(q,k,t)=N_L(\mathbf{D}_{\mathrm{ms}}(E,t)).
\]
For locally \((\rho,\lambda)_L\)-bounded functions, colorings of local Lee balls produce explicit parity constructions with redundancy
\[
r\le \left\lceil \frac{t}{\left\lfloor q/(2\lambda)\right\rfloor}\right\rceil
\]
when \(\lambda\le q/2\) [2508.01702].

The significance is structural. Regular Lee codes impose one scalar lower bound on all pairs. Irregular Lee-distance codes replace this with a geometry of pair-specific constraints induced by a function or task. That shift permits systematic encoders whose redundancy can be strictly smaller than that required either for full error correction of the data or for separate protection of the function values as abstract symbols [2508.01702].

## 4. Universal bounds, spectral obstructions, and the abundance of nonlinear irregular codes

A second major strand of the literature treats irregular Lee codes in the broad sense of arbitrary, possibly nonlinear codes. The central object is still
\[
A_q^L(n,d)=\max\{|C|:C\subseteq\mathbb{Z}_q^n,\ d_{\min}(C)\ge d\},
\]
but no algebraic structure is assumed. A semidefinite programming hierarchy \(B_k(q,n,d)\) is defined over all small subsets \(S\subseteq \mathbb{Z}_q^n\), with constraints \(x(S)=0\) whenever \(d_{\min}(S)<d\) and moment matrices \(M_{k,D}(x)\succeq 0\). The resulting bound
\[
A_q^L(n,d)\le B_k(q,n,d)
\]
holds for all codes, including nonlinear and irregular ones. For \(k=2\), \(B_2\) coincides with the Delsarte bound in the Lee scheme; for \(k=3\), the triple-based SDP produces several new upper bounds on \(A_q^L(n,d)\), and in particular recovers the exact value \(A_4^L(4,5)=49\) [1810.05066].

These SDP bounds are symmetry reduced using the action of \(D_q^n\times S_n\), block-diagonalized representation-theoretically, and therefore remain computable for moderate \(n\). Their importance for irregular codes is direct: they constrain every code of the given Lee distance, whether linear, nonlinear, periodic, non-periodic, or distance-matrix based [1810.05066].

A complementary graph-theoretic viewpoint identifies Lee codes with independent sets in Lee graphs. The Lee graph
\[
G(n,q)=C_q\square \cdots \square C_q
\]
has graph distance equal to Lee distance, and
\[
\alpha_t(G(n,q))=A_L(n,t+1).
\]
Distance-\(t\) colorings of \(G(n,q)\) are partitions of \(\mathbb{Z}_q^n\) into Lee codes of minimum distance at least \(t+1\). Spectral ratio bounds on \(\chi_t(G)\) therefore yield upper bounds on \(A_L(n,d)\) and lower bounds on the number of code classes needed in any partition. For \(d=3\), one obtains
\[
\chi_2(G(n,q))\ge
\begin{cases}
2n+1,& \text{if }-1\text{ is an eigenvalue of }G(n,q),\\
2n+2,& \text{otherwise, except }(n,q)=(1,5),
\end{cases}
\]
and a complete characterization of perfect Lee codes of minimum distance \(3\):
\[
\text{perfect }(n,M,3)_q\text{ Lee code}
\iff
2n+1\mid q^n
\iff
\chi_2(G(n,q))=2n+1.
\]
This gives a spectral and number-theoretic obstruction to perfect regular partitions and, by consequence, constrains any irregular partition into distance-3 Lee codes as well [2404.14839].

The probabilistic side of the subject shows that irregular Lee codes are not exceptional; they are generic. For fixed \(m\) and \(t\), the number of \(t\)-Lee-error-correcting codes in \(\mathbb{Z}_m^n\) is at most
\[
2^{(1+o(1))H_m(n,t)},
\qquad
H_m(n,t)=\frac{m^n}{v_m(n,t)},
\]
for \(1\le t\le 10\sqrt{\theta_m n}\), via graph containers. For larger \(t\), specifically \(10\sqrt{\theta_m n}<t<n^{4/5}\), the number is at most
\[
2^{o(H_m(n,t))}.
\]
For fixed-size nonlinear codes, the density threshold occurs at size \(\sqrt{H_m(n,2t+1)}\): if \(S\in o(\sqrt{H_m(n,2t+1)})\), a random subset of size \(S\) is asymptotically almost surely a \(t\)-Lee-error-correcting code, while if \(S\in \omega(\sqrt{H_m(n,2t+1)})\), it is asymptotically almost surely not [2305.05763].

This suggests a sharp dichotomy. Highly structured regular objects—perfect codes, MLD codes, Lee-equidistant modules—are rare and rigid. By contrast, nonlinear irregular Lee codes are exponentially abundant in the relevant counting regimes. The “generic” Lee code is therefore not a perfect tiling or a classical algebraic design, but an irregular independent set in a large Lee graph [2305.05763].

## 5. Algebraic irregularity over rings: non-free codes, generalized Lee weights, and weight-spectrum heterogeneity

Over \(Z=\mathbb{Z}/p^s\mathbb{Z}\), irregularity is often algebraic rather than merely combinatorial. A linear code has subtype \((k_1,\dots,k_s)\), rank
\[
K=\sum_{i=1}^s k_i,
\]
free rank \(k_1\), and socle
\[
\operatorname{soc}(\mathcal{C})=\langle p^{s-1}\rangle\cap \mathcal{C}.
\]
Non-free codes, with nontrivial \(p\)-torsion, are the ring-theoretic archetype of irregular Lee codes in this setting [2112.06635].

A Plotkin-like inequality for linear Lee codes begins from
\[
d_L(\mathcal{C})\le \frac{|\mathcal{C}|}{|\mathcal{C}|-1}\,\overline{w}_L(\mathcal{C}),
\]
where \(\overline{w}_L(\mathcal{C})\) is the average Lee weight. The refined bound of [2112.06635] uses the rank \(K\) and the torsion depth of a minimal-Hamming-weight vector in the code, yielding
\[
d_L(\mathcal{C})\le A(p,s,1)\,(n-K+1),
\]
with
\[
A(p,s,1)=
\begin{cases}
\dfrac{p^{s-1}(p+1)}{4},& p\text{ odd},\\[4pt]
2^{2s-2},& p=2.
\end{cases}
\]
More generally, if a minimal-Hamming-weight vector lies in \(\mathcal{C}\cap \langle p^{s-\ell}\rangle\), then
\[
d_L(\mathcal{C})\le A(p,s,\ell)\,(n-K+1).
\]
This refines earlier Chiang–Wolf and Wyner–Graham Plotkin-like bounds in the non-free case and explicitly exploits irregular torsion structure [2112.06635].

The same paper also shows that optimal codes for Singleton-like and Plotkin-like Lee bounds are very few. For example, in \(\mathbb{Z}_4^n\), the only linear codes meeting the \(\mathbb{Z}_4\)-Singleton bound are \(\langle(2,\dots,2)\rangle\), its dual, and the ambient space. Over \(\mathbb{Z}_{p^s}\) with \(p\) odd and \(s>1\), Lee-equidistant codes have rank at most \(2\), and the paper completes Wood’s classification by giving explicit minimal-length constructions for rank \(1\) and rank \(2\) cases [2112.06635]. This is an important corrective to the intuition imported from field-based Hamming theory: extremal Lee behavior over rings is often non-free and highly torsion-sensitive.

A different refinement of Lee irregularity appears in generalized Lee weights. Over \(Z=\mathbb{Z}/p^s\mathbb{Z}\), three support notions are introduced: support subtype \((n_0(C),\dots,n_s(C))\), join-Lee support, and column-Lee support. The support subtype records, coordinate by coordinate, which ideal \(\langle p^i\rangle\) is generated by the coordinate projection of the code; this already encodes heterogeneous coordinate activity. Join-Lee generalized weights
\[
d_L^{\vee,r}(C)
=
\min\{|\supp_L^{\vee}(D)|:D\le C,\ \mathrm{rk}(D)=r\}
\]
reduce to generalized Hamming weights of the socle scaled by \(M_{s-1}\), giving the bound
\[
d_L(C)\le M_{s-1}(n-K+1)
=
\Big\lfloor\frac{p}{2}\Big\rfloor p^{s-1}(n-K+1).
\]
Column-Lee generalized weights and filtration subcodes
\[
C_i=C\cap \langle p^i\rangle^n
\]
yield stronger Singleton-like bounds that explicitly track where rows and columns vanish along the \(p\)-adic filtration [2307.06079].

The filtration viewpoint is especially relevant to irregular Lee codes because it captures multi-level protection and heterogeneous coordinates directly. Instead of measuring only the rank of a subcode, it measures how deep subcodes lie inside the ideal filtration. This provides upper bounds on \(d_L(C)\) that are sensitive to the detailed support profile of the code rather than just its ambient length and size [2307.06079].

Over \(\mathbb{Z}_4\), a complementary sort of irregularity appears in Lee weight distributions. Using trace-evaluation codes over \(\mathrm{GR}(4,m)\), several classes of linear codes have explicitly determined Lee weight distributions for odd \(m\). For \(D=D_{t_1}\cup D_{t_2}\) with \(t_1,t_2\) of the same parity, one obtains 3-weight Lee codes of length \(2^{m-1}\). For \(D=D_t\) and for complements \(L\setminus D_t\), one obtains structured multi-weight codes with weights of the form \(2^{m-2}\) or \(3\cdot 2^{m-2}\) perturbed by terms of order \(2^{(m-1)/2}\). For even \(m\), the same constructions yield many more distinct Lee weights and are described as “performing worse,” with full weight distributions not determined [2502.10697]. Here irregularity is spectral rather than geometric: the code remains linear, but its Lee weight spectrum becomes much less uniform.

## 6. Constructions, long-code asymptotics, and open directions

The absence of perfect regular Lee codes does not imply a lack of strong constructive families. One route is via long algebraic-geometric constructions. Concatenation of an outer AG code over \(GF(Q)\) with an inner short Lee-metric code over \(\mathbb{Z}_q\) yields families whose rate \(R\) and relative Lee distance \(\delta\) satisfy
\[
\frac{R}{k/n}+\frac{\delta}{d_L/n}\ge 1-\frac{1}{q^{k/2}-1},
\]
where \([n,k,d_L]\) are the inner parameters. With Lee-metric BCH inner codes over \(\mathbb{Z}_p\), the resulting asymptotic line is approximately \(2R+\delta\approx 1\) for suitable \(p\) and \(t\) [1302.2246].

A more intrinsic AG bound, the corrected “Victorian” bound, shows that from a curve of genus \(g\) over \(\mathbb{F}_q\) with at least \(n+1\) rational points one obtains shortened codes over \(\mathbb{F}_q\) with parameters \([n-1,r-g]\) and Lee distance
\[
d_L\ge \frac{n^2-r^2}{4r},
\]
for \(2g-2<r<n\). Asymptotically, if \(g/n\to\gamma\), then
\[
R\ge -\gamma - 2\delta + \sqrt{4\delta^2+1}.
\]
A further descent argument from \(\mathbb{F}_{p^2}\) to \(\mathbb{F}_p\) uses explicit combinatorics of Lee spheres in \(\mathbb{F}_{p^2}\) to derive constructive lower bounds on the asymptotic Lee-rate function \(\alpha_{Lee,p}(\delta)\) that beat Gilbert-type Lee bounds in substantial parameter ranges [1302.2246]. These families are regular in construction, but they furnish asymptotic benchmarks for any irregular alternative.

Another axis of generalization is the restricted-error model over \(\mathbb{F}_p\). If \(E\subseteq \mathbb{F}_p^\times\) is a subgroup with \(-1\in E\), the restricted weight is
\[
w(x)=\min\{\ell:\exists \varepsilon_1,\dots,\varepsilon_\ell\in E\text{ with }\varepsilon_1+\cdots+\varepsilon_\ell=x\},
\]
and \(E=\{\pm 1\}\) recovers the Lee weight. Gaussian and Eisenstein integer constructions correspond to \(E=\{\pm1,\pm i\}\) and \(E=\{\pm1,\pm\rho,\pm\rho^2\}\), respectively, and explicit parity-check constructions correct two or three such restricted errors [2601.12959]. The paper suggests, at a conceptual level, that one could allow different subgroups \(E_j\) across coordinates, yielding a non-uniform restricted-error metric. This suggests a route toward genuinely irregular Lee-type metrics, although it is presented as a conceptual extension rather than a developed theory [2601.12959].

Several open directions recur across the literature. Nonlinear perfect \(PL(n,2)\)-codes remain open despite strong linear nonexistence evidence [1804.09290]. Quasi-perfect, almost-perfect, and defect-tolerant Lee tilings are repeatedly suggested as the natural replacement for impossible perfect structures [1701.08412], [1802.04608]. Higher-level SDP hierarchies beyond triples may sharpen universal upper bounds for arbitrary Lee codes [1810.05066]. Spectral methods have so far been pushed mainly for \(d=3\), and extending optimized \(\chi_t(G(n,q))\) bounds to higher \(t\) remains nontrivial [2404.14839]. Over \(\mathbb{Z}_4\), the even-\(m\) Lee weight distributions of trace-evaluation constructions remain unresolved [2502.10697]. For FCLCs, broader families of functions and tighter irregular Plotkin- or GV-type bounds remain to be developed [2508.01702].

A recurring conclusion is that irregularity in the Lee metric is not a residual pathology. It is a structural necessity in regimes where perfect tilings fail, a formal design principle in distance-matrix and function-correcting settings, a generic phenomenon in the counting theory of nonlinear codes, and an algebraic resource in ring-linear constructions where torsion, filtration depth, and non-uniform weight spectra materially affect what is achievable.

Source: https://www.emergentmind.com/topics/irregular-lee-distance-codes