---
title: Function-Correcting Lee Codes (FCLCs)
url: https://www.emergentmind.com/topics/function-correcting-lee-codes-fclcs
type: topic
---

# Function-Correcting Lee Codes (FCLCs)

Function-Correcting Lee Codes (FCLCs) are systematic function-correcting codes over \(\mathbb{Z}_m\) designed for Lee-metric channels: instead of requiring reliable recovery of the entire message, they require reliable recovery of a prescribed function \(f(u)\) of the message \(u\), and they do so by enforcing distance constraints only between codewords associated with different function values. In the current literature, this perspective yields an exact redundancy characterization through irregular Lee-distance codes, general Plotkin- and Gilbert–Varshamov-type bounds, exact or near-exact results for several structured function classes, and a direct specialization of homogeneous-distance FCCs over \(\mathbb{Z}_4\), where homogeneous distance coincides with Lee distance [2507.17654].

## 1. Lee-metric setting and correction criterion

The ambient alphabet is \(\mathbb{Z}_m\), \(m\ge 2\), with Lee weight
\[
w_L(x)=\min\{x,m-x\},\qquad x\in\mathbb{Z}_m.
\]
Under the symmetric labeling of residues, this becomes \(w_L(x)=|x|\). For vectors \(u,v\in\mathbb{Z}_m^k\), the Lee distance is
\[
d_L(u,v)=\sum_{i=1}^k w_L(u_i-v_i).
\]
A Lee ball of radius \(\rho\) around \(u\) is \(B_L(u,\rho)=\{v\in\mathbb{Z}_m^k:d_L(u,v)\le \rho\}\), and for \(\rho<m/2\) its volume in \(\mathbb{Z}_m^r\) is
\[
V_L(r,\rho)=\sum_{j=0}^r 2^j\binom{r}{j}\binom{\rho}{j},
\]
which is the volume term used in Gilbert–Varshamov-type arguments [2507.17654].

An FCLC uses a systematic encoder
\[
\mathcal{E}:\mathbb{Z}_m^k\to\mathbb{Z}_m^{k+r},\qquad \mathcal{E}(u)=(u,p(u)),
\]
where \(p(u)\in\mathbb{Z}_m^r\) is the redundancy. For a fixed function \(f:\mathbb{Z}_m^k\to \operatorname{Im}(f)\) and Lee error radius \(t\), the defining requirement is
\[
d_L(\mathcal{E}(u),\mathcal{E}(v))\ge 2t+1\qquad\text{whenever } f(u)\neq f(v).
\]
This is strictly weaker than a classical \(t\)-error-correcting Lee code, which would require the same inequality for all \(u\neq v\). Accordingly, any conventional Lee code with minimum distance \(2t+1\) is automatically an \((f,t)\)-FCLC for every \(f\), but usually with non-optimal redundancy [2507.17654].

The optimal redundancy is
\[
r_f^L(k,t)=\min\left\{r:\exists\ (f,t)\text{-FCLC of length }k+r\right\}.
\]
The decoding implication is purely metric: if the received word \(a\) satisfies \(d_L(a,\mathcal{E}(u))\le t\), then all codewords within Lee radius \(t\) of \(a\) must correspond to the same function value, even if they do not determine the same message. A common misconception is that an FCLC is a weakened decoder for a conventional Lee code; in fact, the code design problem itself is different, because only function-distinct pairs must be separated [2507.17654].

## 2. Irregular Lee-distance codes and exact redundancy characterization

The central structural device is the irregular Lee-distance code. Given a symmetric nonnegative matrix \(D\in\mathbb{N}^{M\times M}\), a set \(C=\{C_1,\dots,C_M\}\subseteq \mathbb{Z}_m^r\) is a \(D\)-code in the Lee metric if
\[
d_L(C_i,C_j)\ge [D]_{ij}\qquad\forall\, i,j.
\]
The minimum length of such a code is denoted \(N_L(D)\). When all off-diagonal entries of \(D\) equal a constant \(d\), this reduces to the standard parameter \(N_L(M,d)\) for an \((M,d)\)-Lee code [2507.17654].

For messages \(u_1,\dots,u_M\in\mathbb{Z}_m^k\), the distance requirement induced by \(f\) and \(t\) is captured by
\[
[D_f^L(t,u_1,\dots,u_M)]_{ij}=
\begin{cases}
[2t+1-d_L(u_i,u_j)]^+, & f(u_i)\neq f(u_j),\\
0, & f(u_i)=f(u_j),
\end{cases}
\]
where \([x]^+=\max\{x,0\}\). This matrix measures exactly how much Lee distance the redundancy part must contribute after the systematic part contributes \(d_L(u_i,u_j)\) [2507.17654].

The exact equivalence theorem states that if \(\mathbb{Z}_m^k=\{u_1,\dots,u_{m^k}\}\), then
\[
r_f^L(k,t)=N_L\big(D_f^L(t,u_1,\dots,u_{m^k})\big).
\]
Thus the optimal redundancy problem for FCLCs is equivalent to the shortest-length problem for an irregular Lee-distance code. A direct lower-bound corollary is that for any subset \(\{u_1,\dots,u_M\}\subseteq \mathbb{Z}_m^k\),
\[
r_f^L(k,t)\ge N_L\big(D_f^L(t,u_1,\dots,u_M)\big).
\]
This reduction is the Lee-metric analogue of the irregular-distance viewpoint used earlier for Hamming-metric FCCs and later for symbol-pair and sum-rank metrics [2507.17654, 2312.16271, 2607.03857].

A second, smaller matrix acts on the image of \(f\). If \(\operatorname{Im}(f)=\{e_1,\dots,e_\eta\}\), define
\[
d_L(e_i,e_j)=\min_{\substack{u_1,u_2\in\mathbb{Z}_m^k\\ f(u_1)=e_i,\ f(u_2)=e_j}} d_L(u_1,u_2),
\]
and then
\[
[D_f^L(t,e_1,\dots,e_\eta)]_{ij}=
\begin{cases}
[2t+1-d_L(e_i,e_j)]^+, & i\neq j,\\
0, & i=j.
\end{cases}
\]
This yields the general upper bound
\[
r_f^L(k,t)\le N_L\big(D_f^L(t,e_1,\dots,e_\eta)\big),
\]
obtained by assigning the same redundancy vector to all messages with the same function value. When one can choose representatives \(u_i\) realizing the same matrix, the upper and lower bounds coincide and give an exact formula [2507.17654].

## 3. General redundancy bounds

The general lower bound is a Plotkin-type inequality for irregular Lee-distance codes. If \(D\) is an \(M\times M\) Lee distance matrix, then
\[
N_L(D)\ge
\begin{cases}
\dfrac{4}{M^2\lfloor m/2\rfloor}\displaystyle\sum_{1\le i<j\le M}[D]_{ij}, & M\text{ even},\\[8pt]
\dfrac{4}{(M^2-1)\lfloor m/2\rfloor}\displaystyle\sum_{1\le i<j\le M}[D]_{ij}, & M\text{ odd}.
\end{cases}
\]
For regular distance \(d\), this yields
\[
N_L(M,d)\ge \frac{2d(M-1)}{M\lfloor m/2\rfloor}.
\]
Two specializations are especially significant: for \(m=2\), Lee distance is Hamming distance, and the bound recovers the Hamming irregular-distance bound of Lenz et al.; for \(m=4\), where Lee distance coincides with homogeneous distance, the resulting bound improves the earlier \(\mathbb{Z}_4\) homogeneous-metric Plotkin bound of Liu–Liu by a factor of \(2\) [2507.17654].

The general upper bound is Gilbert–Varshamov-type:
\[
N_L(D)\le \min\left\{r\in\mathbb{N}: m^r > \max_{j\in[M]} \sum_{i=1}^{j-1} V_L\big(r,[D]_{ij}-1\big)\right\}.
\]
It is obtained by a greedy construction that successively avoids Lee balls of the forbidden radii around previously chosen codewords [2507.17654].

A coarse but function-universal sandwich bound depends only on \(\eta=|\operatorname{Im}(f)|\):
\[
N_L(2,2t)\le r_f^L(k,t)\le N_L(\eta,2t).
\]
The lower bound comes from the existence, for every non-constant \(f\), of two messages at Lee distance \(1\) with different function values; the upper bound comes from assigning one codeword of an \((\eta,2t)\)-Lee code to each function value [2507.17654]. The two-code case is exact:
\[
N_L(2,2t)=\left\lceil \frac{2t}{\lfloor m/2\rfloor}\right\rceil.
\]
Hence every non-constant FCLC satisfies
\[
r_f^L(k,t)\ge \left\lceil \frac{2t}{\lfloor m/2\rfloor}\right\rceil.
\]
For \(m=2\) this becomes \(2t\), and for \(m=4\) it becomes \(t\) [2507.17654].

## 4. Locality in the Lee metric

A major structured subclass is defined through Lee-locality. For a function \(f\), the function ball is
\[
B_L^f(u,\rho)=\{f(v): v\in B_L(u,\rho)\}.
\]
The function is locally \((\lambda,\rho)_L\) if
\[
|B_L^f(u,\rho)|\le \lambda\qquad\forall\,u\in\mathbb{Z}_m^k.
\]
If \(\lambda=2\), one obtains locally binary Lee functions [2507.17654].

The key combinatorial device is a coloring map \(\tau_f^L:\mathbb{Z}_m^k\to[\lambda]\) such that
\[
\tau_f^L(u)\neq \tau_f^L(v)
\]
whenever \(f(v)\in B_L^f(u,\rho)\) or \(f(u)\in B_L^f(v,\rho)\). Using a length-\(N_L(\lambda,2t)\) Lee code \(\{C_1,\dots,C_\lambda\}\), one then encodes
\[
u\mapsto (u,C_{\tau_f^L(u)}),
\]
which yields the general locality bound
\[
r_f^L(k,t)\le N_L(\lambda,2t)
\]
for every locally \((\lambda,2t)_L\) function [2507.17654].

The locally binary case is completely characterized:
\[
r_f^L(k,t)=N_L(2,2t)=\left\lceil\frac{2t}{\lfloor m/2\rfloor}\right\rceil
\]
whenever \(f\) is locally \((2,2t)_L\). This gives an exact redundancy theorem rather than a one-sided bound [2507.17654].

Later explicit-construction work over \(\mathbb{Z}_q\) sharpened the locality picture for locally \((2t,\lambda)_L\)-bounded functions. If \(\lambda\le q/2\), it gives a direct scalar-parity construction with
\[
r=\left\lceil \frac{t}{\left\lfloor q/(2\lambda)\right\rfloor}\right\rceil,
\]
obtained by spacing \(\lambda\) parity symbols in Lee distance and repeating the chosen symbol \(r\) times [2508.01702].

## 5. Canonical function classes

Three function classes dominate the FCLC literature: Lee weight, Lee weight distribution, and modular sum. Over \(\mathbb{Z}_4\), the same classes also appear in the homogeneous-distance FCC literature because homogeneous distance and Lee distance coincide there [2507.03332].

| Function class | Stated Lee-metric result | Source |
|---|---|---|
| \(f(u)=w_L(u)\) | \(r_f^L(k,t)=N_L(D_{w_L}(t))\) | [2507.17654] |
| \(f(u)=\left\lfloor w_L(u)/T\right\rfloor\) | \(r_f^L(k,t)\le N_L(\lfloor 4t/T\rfloor+2,2t)\) | [2507.17654] |
| \(f(u)=\sum u_i \bmod q\) | explicit FCLCs; \(r=t\) for odd \(q\ge 5\) with \(t\le (q-3)/2\), and \(r=2t-1\) for even \(q\ge 6\) | [2508.01702] |
| locally \((2t,\lambda)_L\)-bounded \(f\) | \(r=\left\lceil t/\lfloor q/(2\lambda)\rfloor\right\rceil\) when \(\lambda\le q/2\) | [2508.01702] |

For the Lee weight function \(f(u)=w_L(u)\), the image is \(\{0,1,\dots,k\lfloor m/2\rfloor\}\). The triangle inequality yields
\[
w_L(u)-\rho \le w_L(v)\le w_L(u)+\rho
\]
for every \(v\in B_L(u,\rho)\), so \(w_L\) is locally \((2\rho+1,\rho)_L\). At \(\rho=2t\), this gives
\[
r_f^L(k,t)\le N_L(4t+1,2t).
\]
A stronger result uses explicit representatives \(u_i\) satisfying
\[
w_L(u_i)=i,\qquad d_L(u_i,u_j)=|i-j|.
\]
Consequently,
\[
[D_{w_L}(t)]_{ij}=
\begin{cases}
0,& i=j,\\
[2t+1-|i-j|]^+,& i\neq j,
\end{cases}
\]
and
\[
r_f^L(k,t)=N_L\big(D_{w_L}(t)\big).
\]
For \(k>\left\lceil \frac{t+1}{\lfloor m/2\rfloor}\right\rceil\), one obtains the explicit lower bound
\[
r_f^L(k,t)\ge \frac{10t^3+30t^2+20t}{3(t+2)^2\lfloor m/2\rfloor},
\]
which over \(\mathbb{Z}_4\) specializes to
\[
r_f^L(k,t)\ge \frac{5t^3+15t^2+10t}{3(t+2)^2}.
\]
That \(\mathbb{Z}_4\) specialization exactly matches the earlier Liu–Liu lower bound, but the Lee-metric derivation holds for arbitrary \(\mathbb{Z}_m\) [2507.17654].

For the Lee weight distribution function
\[
W_L^T(u)=\left\lfloor \frac{w_L(u)}{T}\right\rfloor,
\]
the same weight-difference estimate implies
\[
|B_L^f(u,\rho)|\le \left\lfloor \frac{2\rho}{T}\right\rfloor +2.
\]
Hence \(W_L^T\) is locally \(\big(\lfloor 2\rho/T\rfloor+2,\rho\big)_L\), and at \(\rho=2t\),
\[
r_f^L(k,t)\le N_L\big(\lfloor 4t/T\rfloor+2,2t\big).
\]
This makes the dependence on the quantization parameter \(T\) explicit: coarser quantization lowers the effective local alphabet size and can reduce redundancy [2507.17654].

The modular sum function was treated explicitly in later Lee-metric construction work. Over \(\mathbb{Z}_q\), if
\[
f(u)=\sum_{i=1}^k u_i \pmod q,
\]
then there are explicit parity-symbol constructions with redundancy \(r=t\) for odd \(q\ge 5\) and \(t\le (q-3)/2\), and redundancy \(r=2t-1\) for even \(q\ge 6\). The same work also derived lower bounds from a refined Plotkin-like bound and proved optimality in several concrete parameter regimes [2508.01702].

Over \(\mathbb{Z}_4\), the homogeneous-distance study gives additional exact small-\(t\) statements because Lee and homogeneous metrics coincide there. For the Lee weight function on \(\mathbb{Z}_4^k\), it yields
\[
r_L^{w_L}(k,1)=2,\qquad r_L^{w_L}(k,2)=3,
\]
and supplies explicit constructions achieving those values [2507.03332].

## 6. Relation to adjacent FCC frameworks

FCLCs belong to a broader FCC program in which the metric changes but the function-centric logic remains stable. The Hamming-metric literature established the general FCC paradigm and proved the universal lower bound \(r_f(k,t)\ge 2t\) over finite fields, with equality for sufficiently large fields; symbol-pair and sum-rank works then recast the same design problem as one of irregular-distance coding in their respective metrics [2504.14410, 2312.16271, 2607.03857]. This suggests that the Lee-metric theory is not an isolated construction but one instance of a metric-dependent, irregular-distance framework.

At the same time, the Lee case has distinctive algebraic features. On \(\mathbb{Z}_4\), the homogeneous weight
\[
\omega_h(0)=0,\quad \omega_h(1)=\omega_h(3)=1,\quad \omega_h(2)=2
\]
is exactly the Lee weight, so every FCCHD over \(\mathbb{Z}_4\) is literally an FCLC [2507.03332]. For \(\mathbb{Z}_{2^s}\) with \(s>2\), homogeneous distance remains a closely related but broader framework, and later work on finite chain rings extends locality, linear-function bounds, and explicit constructions in that setting [2603.14471].

A further branch studies strict FCCs with data protection, where the function is protected at a higher distance level than the underlying data. Those results are currently stated in the Hamming metric and use \(\alpha\)-distance graphs, Cayley-graph structure, and subcodes generated by low-weight codewords [2603.01049, 2604.26397]. A plausible implication is that analogous Lee-distance graphs and Lee-weight-generated subcodes could support a strict Lee-metric theory, but that step is presented as a prospective direction rather than an established Lee-metric theorem in the cited works.

Across this literature, the central distinction remains the same: FCLCs are not merely Lee-metric error-correcting codes with a specialized decoder; they are codes whose distance constraints, redundancy bounds, and explicit constructions are tailored to the function itself. Later explicit comparisons with classical Lee error-correcting codes and codes that encode only function values show that FCLCs can significantly reduce redundancy while preserving function correctness [2508.01702].

Source: https://www.emergentmind.com/topics/function-correcting-lee-codes-fclcs