Documentation

CslibFrontier.Foundations.Data.Code.InterleavedCurve

Curve-batched, Johnson-bound, and uniquely decoded interleaved Reed–Solomon codes #

CslibFrontier.Foundations.Data.Code.Interleaved formalizes κ-interleaved linear codes Cslib.Code.interleavedLinear κ C and random-vector row combinations i ↦ ∑ r : Fin m, z r • W i r up to one-third minimum distance for general linear codes and up to the unique-decoding radius 2 * e + k ≤ |ι| for Reed–Solomon codes. This module extends that API in three directions for #5968 and #643:

  1. Uniqueness and joint Berlekamp–Welch decoding in the unique-decoding regime (eq_of_mem_interleavedLinear_reedSolomon, berlekampWelchInterleaved): inside 2 * e + k ≤ |ι|, at most one interleaved Reed–Solomon codeword lies within column-Hamming distance e of a received matrix W : ι → κ → F, and running Cslib.Code.berlekampWelch on each row followed by a joint column-distance check ≤ e succeeds if and only if the rows share correlated agreement on at least |ι| - e coordinates (berlekampWelchInterleaved_eq_some_iff, berlekampWelchInterleaved_eq_none_iff).
  2. Single-scalar power / parameterized-curve batching in the unique-decoding regime (toOuterMeasure_sum_pow_smul_reedSolomon_close_le, exists_unique_mem_interleavedLinear_reedSolomon_of_pow, derived from [BenSassonCarmonIshaiKoppartySaraf2020, Theorems 1.5 and 6.1] via Cslib.Code.exists_correlatedAgreement_curve_unique): replacing m independent random scalars z : Fin m → F by powers 1, z, …, z ^ (m - 1) of a single uniform scalar z : F bounds the false-closeness probability of any e-far matrix W : ι → Fin m → F by ((m - 1) * |ι|) / |F| uniformly for all m : ℕ, with unique interleaved-codeword recovery above that threshold.
  3. Johnson-bound (1 - √ρ) interleaved Reed–Solomon proximity bounds for both affine-vector batching (z : Fin m → F, row-count-independent error) and single-scalar power batching (z : F):

Main definitions #

Main results #

References #

Uniqueness and joint Berlekamp–Welch decoding for interleaved Reed–Solomon codes #

theorem Cslib.Code.eq_of_mem_interleavedLinear_reedSolomon {F : Type u_1} {ι : Type u_2} {κ : Type u_3} [Field F] [DecidableEq F] [Fintype ι] [Fintype κ] {α : ι → F} (hα : Function.Injective α) {e k : ℕ} (hunique : 2 * e + k ≤ Fintype.card ι) {W V₁ V₂ : ι → κ → F} (hV₁ : V₁ ∈ interleavedLinear κ (reedSolomon α k)) (hV₂ : V₂ ∈ interleavedLinear κ (reedSolomon α k)) (hd₁ : hammingDist W V₁ ≤ e) (hd₂ : hammingDist W V₂ ≤ e) :
V₁ = V₂

Unique decoding for interleaved Reed–Solomon codes: with distinct evaluation points α : ι → F and 2 * e + k ≤ |ι|, at most one interleaved codeword V ∈ interleavedLinear κ (reedSolomon α k) lies within column-Hamming distance e of W.

noncomputable def Cslib.Code.berlekampWelchInterleaved {F : Type u_1} {ι : Type u_2} {κ : Type u_3} [Field F] [Fintype ι] [Fintype κ] [DecidableEq F] (α : ι → F) (e k : ℕ) (W : ι → κ → F) :
Option (κ → Polynomial F)

Joint Berlekamp–Welch decoder for κ-interleaved Reed–Solomon codes: decodes each row i ↦ W i r (r : κ) via Cslib.Code.berlekampWelch α e k and accepts the resulting polynomial family P : κ → F[X] when the joint column-Hamming distance from i r ↦ (P r).eval (α i) to W is at most e (enforcing correlated agreement across all rows, not merely independent per-row proximity). As with Cslib.Code.berlekampWelch, solutions are chosen noncomputably and no running time is claimed.

theorem Cslib.Code.degree_lt_of_berlekampWelchInterleaved_eq_some {F : Type u_1} {ι : Type u_2} {κ : Type u_3} [Field F] [Fintype ι] [Fintype κ] [DecidableEq F] {α : ι → F} {e k : ℕ} {W : ι → κ → F} {P : κ → Polynomial F} (h : berlekampWelchInterleaved α e k W = some P) (r : κ) :
(P r).degree < ↑k

Degree soundness of berlekampWelchInterleaved: for every received matrix W, every row polynomial returned by berlekampWelchInterleaved α e k W has degree strictly less than k.

theorem Cslib.Code.hammingDist_le_of_berlekampWelchInterleaved_eq_some {F : Type u_1} {ι : Type u_2} {κ : Type u_3} [Field F] [Fintype ι] [Fintype κ] [DecidableEq F] {α : ι → F} {e k : ℕ} {W : ι → κ → F} {P : κ → Polynomial F} (h : berlekampWelchInterleaved α e k W = some P) :
hammingDist (fun (i : ι) (r : κ) => Polynomial.eval (α i) (P r)) W ≤ e

Joint distance soundness of berlekampWelchInterleaved: for every received matrix W, an output P of berlekampWelchInterleaved α e k W evaluates to an interleaved codeword within column-Hamming distance e of W.

theorem Cslib.Code.berlekampWelchInterleaved_eq_some_iff {F : Type u_1} {ι : Type u_2} {κ : Type u_3} [Field F] [Fintype ι] [Fintype κ] [DecidableEq F] {α : ι → F} (hα : Function.Injective α) {e k : ℕ} (hunique : 2 * e + k ≤ Fintype.card ι) {W : ι → κ → F} {P : κ → Polynomial F} :
berlekampWelchInterleaved α e k W = some P ↔ (∀ (r : κ), (P r).degree < ↑k) ∧ hammingDist (fun (i : ι) (r : κ) => Polynomial.eval (α i) (P r)) W ≤ e

Characterization of berlekampWelchInterleaved in the unique-decoding regime (2 * e + k ≤ |ι|): with distinct evaluation points α : ι → F, the decoder returns some P if and only if every P r has degree < k and i r ↦ (P r).eval (α i) has column-Hamming distance at most e from W.

theorem Cslib.Code.berlekampWelchInterleaved_eq_none_iff {F : Type u_1} {ι : Type u_2} {κ : Type u_3} [Field F] [Fintype ι] [Fintype κ] [DecidableEq F] {α : ι → F} (hα : Function.Injective α) {e k : ℕ} (hunique : 2 * e + k ≤ Fintype.card ι) {W : ι → κ → F} :

Failure characterization of berlekampWelchInterleaved in the unique-decoding regime (2 * e + k ≤ |ι|): the decoder returns none if and only if W has column-Hamming distance strictly greater than e from every codeword of interleavedLinear κ (reedSolomon α k).

Single-scalar curve-batched Reed–Solomon proximity in the unique-decoding regime #

theorem Cslib.Code.toOuterMeasure_sum_pow_smul_reedSolomon_close_le {F : Type u_1} {ι : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Fintype ι] {α : ι → F} (hα : Function.Injective α) {e k m : ℕ} (hunique : 2 * e + k ≤ Fintype.card ι) {W : ι → Fin m → F} (hfar : ∀ V ∈ interleavedLinear (Fin m) (reedSolomon α k), e < hammingDist W V) :
(Probability.PMF.uniformOfFintype F).toOuterMeasure {z : F | ∃ c ∈ reedSolomon α k, hammingDist (fun (i : ι) => ∑ r : Fin m, z ^ ↑r • W i r) c ≤ e} ≤ ↑((m - 1) * Fintype.card ι) / ↑(Fintype.card F)

Single-scalar curve-batched Reed–Solomon proximity bound in the unique-decoding regime (2 * e + k ≤ |ι|, derived from [BenSassonCarmonIshaiKoppartySaraf2020, Theorems 1.5 and 6.1] via Cslib.Code.exists_correlatedAgreement_curve_unique): over a finite field F with distinct evaluation points α : ι → F, if W : ι → Fin m → F has column-Hamming distance strictly greater than e from interleavedLinear (Fin m) (reedSolomon α k), then a single uniformly sampled scalar z : F produces a power row combination i ↦ ∑ r : Fin m, z ^ (r : ℕ) • W i r within Hamming distance e of reedSolomon α k with probability at most ((m - 1) * |ι|) / |F| uniformly for all m : ℕ.

theorem Cslib.Code.exists_unique_mem_interleavedLinear_reedSolomon_of_pow {F : Type u_1} {ι : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Fintype ι] {α : ι → F} (hα : Function.Injective α) {e k m : ℕ} (hunique : 2 * e + k ≤ Fintype.card ι) {W : ι → Fin m → F} (hprob : ↑((m - 1) * Fintype.card ι) / ↑(Fintype.card F) < (Probability.PMF.uniformOfFintype F).toOuterMeasure {z : F | ∃ c ∈ reedSolomon α k, hammingDist (fun (i : ι) => ∑ r : Fin m, z ^ ↑r • W i r) c ≤ e}) :
∃! V : ι → Fin m → F, V ∈ interleavedLinear (Fin m) (reedSolomon α k) ∧ hammingDist W V ≤ e

Single-scalar curve-batched correlated agreement and unique extraction in the unique-decoding regime (2 * e + k ≤ |ι|): if i ↦ ∑ r : Fin m, z ^ (r : ℕ) • W i r lies within Hamming distance e of reedSolomon α k with probability strictly greater than ((m - 1) * |ι|) / |F| over uniform z : F, then there exists a unique interleaved codeword V ∈ interleavedLinear (Fin m) (reedSolomon α k) within column-Hamming distance e of W.

Johnson-bound (1 - √ρ) interleaved Reed–Solomon proximity bounds #

theorem Cslib.Code.toOuterMeasure_sum_smul_reedSolomon_close_le_johnson_exact {F : Type u_1} {ι : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Fintype ι] {α : ι → F} (hα : Function.Injective α) {k m e m_GS D : ℕ} (hk : 1 ≤ k) (hm_GS : 1 ≤ m_GS) (hk_le : k ≤ Fintype.card ι - e) (hinterp : Fintype.card ι * (m_GS * (m_GS + 1) / 2) < (Sudan.monomials (k - 1) D).card) (hroot : D < m_GS * (Fintype.card ι - e)) {W : ι → Fin m → F} (hfar : ∀ V ∈ interleavedLinear (Fin m) (reedSolomon α k), e < hammingDist W V) :
(Probability.PMF.uniformOfFintype (Fin m → F)).toOuterMeasure {z : Fin m → F | ∃ c ∈ reedSolomon α k, hammingDist (fun (i : ι) => ∑ r : Fin m, z r • W i r) c ≤ e} ≤ ↑(ProximityGap.johnsonCurveBound (Fintype.card ι) m_GS (k - 1) D 1 (Fintype.card ι)) / ↑(Fintype.card F)

Explicit-parameter Guruswami–Sudan interleaved Reed–Solomon proximity bound up to the Johnson bound (affine-vector batching) (in the setting of [BenSassonCarmonIshaiKoppartySaraf2020, Theorems 1.2 and 1.6], derived via Cslib.Code.exists_correlatedAgreement_affine_johnson): for any Guruswami–Sudan multiplicity m_GS ≥ 1 and weighted degree D satisfying k ≤ |ι| - e, |ι| * (m_GS * (m_GS + 1) / 2) < #(Sudan.monomials (k - 1) D), and D < m_GS * (|ι| - e), any e-far word W : ι → Fin m → F produces an e-close uniform row combination i ↦ ∑ r, z r • W i r with probability at most johnsonCurveBound |ι| m_GS (k - 1) D 1 |ι| / |F|, with zero dependence on the row count m and no auxiliary list-size hypothesis.

theorem Cslib.Code.toOuterMeasure_sum_smul_reedSolomon_close_le_johnson {F : Type u_1} {ι : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Fintype ι] {α : ι → F} (hα : Function.Injective α) {e k m_GS m : ℕ} (hk : 1 ≤ k) (hkn : k ≤ Fintype.card ι) (hm_GS : 1 ≤ m_GS) (he : ↑e / ↑(Fintype.card ι) ≤ 1 - √(↑k / ↑(Fintype.card ι)) - √(↑k / ↑(Fintype.card ι)) / (2 * ↑m_GS)) {W : ι → Fin m → F} (hfar : ∀ V ∈ interleavedLinear (Fin m) (reedSolomon α k), e < hammingDist W V) :
(Probability.PMF.uniformOfFintype (Fin m → F)).toOuterMeasure {z : Fin m → F | ∃ c ∈ reedSolomon α k, hammingDist (fun (i : ι) => ∑ r : Fin m, z r • W i r) c ≤ e} ≤ ENNReal.ofReal (1800 * (↑m_GS + 1) ^ 6 * ↑(Fintype.card ι) ^ 2 / (↑k / ↑(Fintype.card ι) * ↑(Fintype.card F)))

Original explicit-constant interleaved Reed–Solomon proximity bound up to the Johnson bound (affine-vector batching, multiplicity form) (in the setting of [BenSassonCarmonIshaiKoppartySaraf2020, Theorems 1.2 and 1.6], derived via Cslib.Code.exists_correlatedAgreement_affine_johnson_of_multiplicity): for 1 ≤ k ≤ |ι|, m_GS ≥ 1, and (e : ℝ) / |ι| ≤ 1 - √ρ - √ρ / (2 * m_GS) (ρ = k / |ι|), an e-far word W : ι → Fin m → F produces an e-close uniform row combination with probability at most 1800 * (m_GS + 1) ^ 6 * |ι| ^ 2 / (ρ * |F|), uniformly for all m : ℕ (using this library's explicit Siegel constant rather than the paper's displayed finite constant).

theorem Cslib.Code.toOuterMeasure_sum_smul_reedSolomon_close_le_johnson_of_eta {F : Type u_1} {ι : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Fintype ι] {α : ι → F} (hα : Function.Injective α) {e k m : ℕ} {η : ℝ} (hk : 1 ≤ k) (hkn : k ≤ Fintype.card ι) (hη : 0 < η) (he : ↑e / ↑(Fintype.card ι) ≤ 1 - √(↑k / ↑(Fintype.card ι)) - η) {W : ι → Fin m → F} (hfar : ∀ V ∈ interleavedLinear (Fin m) (reedSolomon α k), e < hammingDist W V) :
(Probability.PMF.uniformOfFintype (Fin m → F)).toOuterMeasure {z : Fin m → F | ∃ c ∈ reedSolomon α k, hammingDist (fun (i : ι) => ∑ r : Fin m, z r • W i r) c ≤ e} ≤ ENNReal.ofReal (115200 * ↑(Fintype.card ι) ^ 2 / (↑k / ↑(Fintype.card ι) * η ^ 6 * ↑(Fintype.card F)))

Original explicit-constant interleaved Reed–Solomon proximity bound up to 1 - √ρ - η (affine-vector batching) (in the setting of [BenSassonCarmonIshaiKoppartySaraf2020, Theorems 1.2 and 1.6], derived via toOuterMeasure_sum_smul_reedSolomon_close_le_johnson and Cslib.Code.ProximityGap.exists_multiplicity_of_eta): for 1 ≤ k ≤ |ι|, η > 0, and (e : ℝ) / |ι| ≤ 1 - √ρ - η, an e-far word W : ι → Fin m → F produces an e-close uniform row combination with probability at most 115200 * |ι| ^ 2 / (ρ * η ^ 6 * |F|), independent of the row count m : ℕ (using this library's explicit Siegel constant).

theorem Cslib.Code.toOuterMeasure_sum_pow_smul_reedSolomon_close_le_johnson_exact {F : Type u_1} {ι : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Fintype ι] {α : ι → F} (hα : Function.Injective α) {k m e m_GS D : ℕ} (hk : 1 ≤ k) (hm_GS : 1 ≤ m_GS) (hk_le : k ≤ Fintype.card ι - e) (hinterp : Fintype.card ι * (m_GS * (m_GS + 1) / 2) < (Sudan.monomials (k - 1) D).card) (hroot : D < m_GS * (Fintype.card ι - e)) {W : ι → Fin m → F} (hfar : ∀ V ∈ interleavedLinear (Fin m) (reedSolomon α k), e < hammingDist W V) :
(Probability.PMF.uniformOfFintype F).toOuterMeasure {z : F | ∃ c ∈ reedSolomon α k, hammingDist (fun (i : ι) => ∑ r : Fin m, z ^ ↑r • W i r) c ≤ e} ≤ ↑(ProximityGap.johnsonCurveBound (Fintype.card ι) m_GS (k - 1) D (m - 1) (Fintype.card ι)) / ↑(Fintype.card F)

Explicit-parameter Guruswami–Sudan interleaved Reed–Solomon proximity bound up to the Johnson bound (single-scalar power batching) (in the setting of [BenSassonCarmonIshaiKoppartySaraf2020, Theorems 1.5 and 6.2], derived via Cslib.Code.exists_correlatedAgreement_curve_johnson): for any e-far word W : ι → Fin m → F, a single uniform scalar z : F produces an e-close power combination i ↦ ∑ r : Fin m, z ^ (r : ℕ) • W i r with probability at most johnsonCurveBound |ι| m_GS (k - 1) D (m - 1) |ι| / |F| uniformly for all m : ℕ.

theorem Cslib.Code.toOuterMeasure_sum_pow_smul_reedSolomon_close_le_johnson {F : Type u_1} {ι : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Fintype ι] {α : ι → F} (hα : Function.Injective α) {e k m_GS m : ℕ} (hk : 1 ≤ k) (hkn : k ≤ Fintype.card ι) (hm_GS : 1 ≤ m_GS) (he : ↑e / ↑(Fintype.card ι) ≤ 1 - √(↑k / ↑(Fintype.card ι)) - √(↑k / ↑(Fintype.card ι)) / (2 * ↑m_GS)) {W : ι → Fin m → F} (hfar : ∀ V ∈ interleavedLinear (Fin m) (reedSolomon α k), e < hammingDist W V) :
(Probability.PMF.uniformOfFintype F).toOuterMeasure {z : F | ∃ c ∈ reedSolomon α k, hammingDist (fun (i : ι) => ∑ r : Fin m, z ^ ↑r • W i r) c ≤ e} ≤ ENNReal.ofReal (1800 * ↑(m - 1) * (↑m_GS + 1) ^ 6 * ↑(Fintype.card ι) ^ 2 / (↑k / ↑(Fintype.card ι) * ↑(Fintype.card F)))

Original explicit-constant interleaved Reed–Solomon proximity bound up to the Johnson bound (single-scalar power batching, multiplicity form) (in the setting of [BenSassonCarmonIshaiKoppartySaraf2020, Theorems 1.5 and 6.2]): for 1 ≤ k ≤ |ι|, m_GS ≥ 1, and (e : ℝ) / |ι| ≤ 1 - √ρ - √ρ / (2 * m_GS), an e-far word W : ι → Fin m → F produces an e-close single-scalar power combination with probability at most 1800 * (m - 1) * (m_GS + 1) ^ 6 * |ι| ^ 2 / (ρ * |F|) uniformly for all m : ℕ (using this library's explicit Siegel constant).

theorem Cslib.Code.toOuterMeasure_sum_pow_smul_reedSolomon_close_le_johnson_of_eta {F : Type u_1} {ι : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Fintype ι] {α : ι → F} (hα : Function.Injective α) {e k m : ℕ} {η : ℝ} (hk : 1 ≤ k) (hkn : k ≤ Fintype.card ι) (hη : 0 < η) (he : ↑e / ↑(Fintype.card ι) ≤ 1 - √(↑k / ↑(Fintype.card ι)) - η) {W : ι → Fin m → F} (hfar : ∀ V ∈ interleavedLinear (Fin m) (reedSolomon α k), e < hammingDist W V) :
(Probability.PMF.uniformOfFintype F).toOuterMeasure {z : F | ∃ c ∈ reedSolomon α k, hammingDist (fun (i : ι) => ∑ r : Fin m, z ^ ↑r • W i r) c ≤ e} ≤ ENNReal.ofReal (115200 * ↑(m - 1) * ↑(Fintype.card ι) ^ 2 / (↑k / ↑(Fintype.card ι) * η ^ 6 * ↑(Fintype.card F)))

Original explicit-constant interleaved Reed–Solomon proximity bound up to 1 - √ρ - η (single-scalar power batching) (in the setting of [BenSassonCarmonIshaiKoppartySaraf2020, Theorems 1.5 and 6.2]): for 1 ≤ k ≤ |ι|, η > 0, and (e : ℝ) / |ι| ≤ 1 - √ρ - η, an e-far word W : ι → Fin m → F produces an e-close single-scalar power combination with probability at most 115200 * (m - 1) * |ι| ^ 2 / (ρ * η ^ 6 * |F|) uniformly for all m : ℕ (using this library's explicit Siegel constant).