Documentation

CslibFrontier.Foundations.Data.Code.GuruswamiSudan

Guruswami–Sudan list decoding for Reed–Solomon codes #

Let w : ι → F be a received word on n = |ι| distinct evaluation points α : ι → F over an arbitrary field F (of any characteristic). The Guruswami–Sudan list decoder [GS99b], [GuruswamiRudraSudan2019, §§12.2.3–12.2.4, Definitions 12.2.8–9, Algorithm 12.2.3, Lemmas 12.2.10–11, and Theorem 12.2.12 (pp. 253–259)] strengthens Sudan's decoder (Cslib.Code.sudan) by requiring the bivariate interpolant Q(X, Y) ∈ F[X][Y] of (1, d)-weighted degree at most D to vanish to multiplicity at least m (or per-point multiplicity mult i) at every point (α i, w i).

The underlying polynomial algebra — bivariate Taylor shifts (Polynomial.Bivariate.shift), bivariate Hasse derivatives (Polynomial.Bivariate.hasseDerivBiv), characteristic-independent multiplicity-m vanishing (Polynomial.Bivariate.VanishesToOrder), (1, d)-weighted degree (Polynomial.Bivariate.weightedDegree), and primitive/square-free/irreducible factor refinement — lives in CslibFrontier.Foundations.Algebra.Polynomial.Bivariate. The bounded-monomial linear system and least-Y-degree elimination machinery (Cslib.Code.Sudan.exists_weightedDegreeLE_eq_zero, Cslib.Code.Sudan.minDegPoly) are shared with CslibFrontier.Foundations.Data.Code.SudanInterpolant.

Each point with multiplicity mult i imposes mult i * (mult i + 1) / 2 homogeneous linear equations on the coefficients of Q (Cslib.Code.GuruswamiSudan.card_multPairs), so a nonzero weighted-multiplicity interpolant (Cslib.Code.GuruswamiSudan.IsWeightedInterpolant) exists whenever ∑ i, mult i * (mult i + 1) / 2 < #(Sudan.monomials d D) (Cslib.Code.GuruswamiSudan.exists_isWeightedInterpolant). Specializing to a constant profile fun _ => m gives uniform multiplicity-m interpolants (Cslib.Code.GuruswamiSudan.IsInterpolant, Cslib.Code.GuruswamiSudan.exists_isInterpolant), which exist whenever 1 ≤ d and n * d * m * (m + 1) < (D + 1) * (D + 2) (Cslib.Code.GuruswamiSudan.exists_isInterpolant_of_lt). Instantiating Cslib.Code.Sudan.minDegPoly with shifted-coefficient rows (Cslib.Code.GuruswamiSudan.shiftEntry) yields explicit least-Y-degree elimination interpolants (Cslib.Code.GuruswamiSudan.weightedInterpolant, Cslib.Code.GuruswamiSudan.interpolant) satisfying Cslib.Code.GuruswamiSudan.isWeightedInterpolant_weightedInterpolant and Cslib.Code.GuruswamiSudan.natDegree_weightedInterpolant_le; minimizing Y-degree also caps every polynomial root's multiplicity (Cslib.Code.GuruswamiSudan.IsWeightedInterpolant.rootMultiplicity_le_of_min). If P has natDegree ≤ d and D < ∑ i ∈ {i | P.eval (α i) = w i}, mult i (in the uniform case D < m * #{i | P.eval (α i) = w i}), then Q.eval P = 0 and Y - C P ∣ Q (Cslib.Code.GuruswamiSudan.IsWeightedInterpolant.eval_eq_zero, Cslib.Code.GuruswamiSudan.IsInterpolant.X_sub_C_dvd).

For Reed–Solomon codes of dimension k ≥ 2, Cslib.Code.guruswamiSudan achieves list decoding up to the full Johnson radius n * (k - 1) < (n - e) ^ 2 (Cslib.Code.mem_guruswamiSudan_johnson_iff), and asymptotically up to δ = 1 - √ρ - ε for every ε > 0 with multiplicity depending only on ε (Cslib.Code.exists_guruswamiSudan_of_eps). As in Cslib.Code.sudan, roots in F[X][Y] are taken noncomputably via Polynomial.roots and no running time is formalized here.

Main definitions #

Main results #

References #

theorem Cslib.Code.GuruswamiSudan.coeff_coeff_shift_bivariateOf {F : Type u_1} [Field F] (M : Finset (ℕ × ℕ)) (c : ℕ × ℕ → F) (x y : F) (r s : ℕ) :
(((Polynomial.Bivariate.shift x y) (Sudan.bivariateOf M c)).coeff s).coeff r = ∑ m ∈ M, c m * (↑(m.1.choose r) * ↑(m.2.choose s) * x ^ (m.1 - r) * y ^ (m.2 - s))

The (r, s) coefficient of Polynomial.Bivariate.shift x y on Sudan.bivariateOf M c.

The pairs (r, s) with r + s < m, indexing the multiplicity-m vanishing conditions at each point.

theorem Cslib.Code.GuruswamiSudan.mem_multPairs {m : ℕ} {rs : ℕ × ℕ} :
rs ∈ multPairs m ↔ rs.1 + rs.2 < m

(r, s) ∈ multPairs m iff r + s < m.

Twice the number of multiplicity-m pairs is m * (m + 1).

The number of multiplicity-m pairs at each point is m * (m + 1) / 2.

structure Cslib.Code.GuruswamiSudan.IsWeightedInterpolant {F : Type u_1} {ι : Type u_2} [Field F] (α w : ι → F) (mult : ι → ℕ) (d D : ℕ) (Q : Polynomial (Polynomial F)) :

Q is a weighted-multiplicity Guruswami–Sudan interpolant for the received word w at evaluation points α, with per-point multiplicities mult : ι → ℕ, weight d, and weighted degree bound D: a nonzero bivariate polynomial of (1, d)-weighted degree at most D vanishing to order at least mult i at each (α i, w i).

  • ne_zero : Q ≠ 0

    The interpolant is nonzero.

  • weightedDegree_le : Sudan.WeightedDegreeLE d D Q

    Every monomial X ^ a * Y ^ b of Q has (1, d)-weighted degree a + d * b at most D.

  • vanishes (i : ι) : Polynomial.Bivariate.VanishesToOrder (mult i) (α i) (w i) Q

    The interpolant vanishes to order at least mult i at each point (α i, w i).

@[reducible, inline]
abbrev Cslib.Code.GuruswamiSudan.IsInterpolant {F : Type u_1} {ι : Type u_2} [Field F] (α w : ι → F) (m d D : ℕ) (Q : Polynomial (Polynomial F)) :

Q is a multiplicity-m Guruswami–Sudan interpolant for the received word w at evaluation points α, with weight d and weighted degree bound D: the specialization of IsWeightedInterpolant to the constant multiplicity profile fun _ => m.

theorem Cslib.Code.GuruswamiSudan.IsWeightedInterpolant.natDegree_mul_le {F : Type u_1} {ι : Type u_2} [Field F] {α w : ι → F} {mult : ι → ℕ} {d D : ℕ} {Q : Polynomial (Polynomial F)} (hQ : IsWeightedInterpolant α w mult d D Q) :

The Y-degree of a weighted interpolant satisfies Q.natDegree * d ≤ D.

theorem Cslib.Code.GuruswamiSudan.isInterpolant_one_iff_sudan {F : Type u_1} {ι : Type u_2} [Field F] {α w : ι → F} {d D : ℕ} {Q : Polynomial (Polynomial F)} :
IsInterpolant α w 1 d D Q ↔ Sudan.IsInterpolant α w d D Q

Multiplicity-1 Guruswami–Sudan interpolants are Sudan interpolants.

theorem Cslib.Code.GuruswamiSudan.IsWeightedInterpolant.rootMultiplicity_le_of_min {F : Type u_1} {ι : Type u_2} [Field F] {α w : ι → F} {mult : ι → ℕ} {m d D : ℕ} {Q : Polynomial (Polynomial F)} (hQ : IsWeightedInterpolant α w mult d D Q) (hmin : ∀ (Q' : Polynomial (Polynomial F)), IsWeightedInterpolant α w mult d D Q' → Q.natDegree ≤ Q'.natDegree) (hmult : ∀ (i : ι), mult i ≤ m) (P : Polynomial F) :

Least-Y-degree multiplicity bound. If Q is a weighted-multiplicity interpolant of minimum Y-degree and every point multiplicity satisfies mult i ≤ m, then no polynomial P : F[X] is a root of Q of multiplicity strictly exceeding m.

theorem Cslib.Code.GuruswamiSudan.IsInterpolant.rootMultiplicity_le_of_min {F : Type u_1} {ι : Type u_2} [Field F] {α w : ι → F} {m d D : ℕ} {Q : Polynomial (Polynomial F)} (hQ : IsInterpolant α w m d D Q) (hmin : ∀ (Q' : Polynomial (Polynomial F)), IsInterpolant α w m d D Q' → Q.natDegree ≤ Q'.natDegree) (P : Polynomial F) :

Least-Y-degree multiplicity bound for uniform multiplicity-m interpolants: no polynomial P : F[X] is a root of Q of multiplicity strictly exceeding m.

def Cslib.Code.GuruswamiSudan.shiftEntry {F : Type u_1} {ι : Type u_2} [Field F] (α w : ι → F) (mult : ι → ℕ) (row : (i : ι) × ↥(multPairs (mult i))) (ab : ℕ × ℕ) :
F

Matrix entry for the (r, s)-th shifted coefficient at (α i, w i) of the monomial X ^ a * Y ^ b.

theorem Cslib.Code.GuruswamiSudan.exists_isWeightedInterpolant {F : Type u_1} {ι : Type u_2} [Field F] {mult : ι → ℕ} {d D : ℕ} [Fintype ι] (α w : ι → F) (hn : ∑ i : ι, mult i * (mult i + 1) / 2 < (Sudan.monomials d D).card) :
∃ (Q : Polynomial (Polynomial F)), IsWeightedInterpolant α w mult d D Q

Existence of a weighted-multiplicity interpolant. Whenever the number of monomials of (1, d)-weighted degree at most D exceeds ∑ i, mult i * (mult i + 1) / 2, every received word has a nonzero weighted-multiplicity interpolant.

theorem Cslib.Code.GuruswamiSudan.exists_isWeightedInterpolant_min_natDegree {F : Type u_1} {ι : Type u_2} [Field F] {mult : ι → ℕ} {d D : ℕ} [Fintype ι] (α w : ι → F) (hn : ∑ i : ι, mult i * (mult i + 1) / 2 < (Sudan.monomials d D).card) :
∃ (Q : Polynomial (Polynomial F)), IsWeightedInterpolant α w mult d D Q ∧ ∀ (Q' : Polynomial (Polynomial F)), IsWeightedInterpolant α w mult d D Q' → Q.natDegree ≤ Q'.natDegree

Existence of a weighted-multiplicity interpolant of least Y-degree (valid for all d, including d = 0).

theorem Cslib.Code.GuruswamiSudan.exists_isInterpolant {F : Type u_1} {ι : Type u_2} [Field F] {m d D : ℕ} [Fintype ι] (α w : ι → F) (hn : Fintype.card ι * (m * (m + 1) / 2) < (Sudan.monomials d D).card) :
∃ (Q : Polynomial (Polynomial F)), IsInterpolant α w m d D Q

Existence of a multiplicity-m interpolant. Whenever the number of monomials of (1, d)-weighted degree at most D exceeds |ι| * (m * (m + 1) / 2), every received word has a nonzero multiplicity-m interpolant.

theorem Cslib.Code.GuruswamiSudan.card_mul_lt_card_monomials_of_lt {n m d D : ℕ} (hd : 1 ≤ d) (h : n * d * m * (m + 1) < (D + 1) * (D + 2)) :
n * (m * (m + 1) / 2) < (Sudan.monomials d D).card

Closed-form existence of a multiplicity-m interpolant. For d ≥ 1, whenever |ι| * d * m * (m + 1) < (D + 1) * (D + 2), there are strictly more monomials of (1, d)-weighted degree at most D than multiplicity-m constraints, so an interpolant exists.

theorem Cslib.Code.GuruswamiSudan.exists_isInterpolant_of_lt {F : Type u_1} {ι : Type u_2} [Field F] {m d D : ℕ} [Fintype ι] (α w : ι → F) (hd : 1 ≤ d) (h : Fintype.card ι * d * m * (m + 1) < (D + 1) * (D + 2)) :
∃ (Q : Polynomial (Polynomial F)), IsInterpolant α w m d D Q

Existence of a multiplicity-m interpolant from |ι| * d * m * (m + 1) < (D + 1) * (D + 2).

theorem Cslib.Code.GuruswamiSudan.IsWeightedInterpolant.eval_eq_zero {F : Type u_1} {ι : Type u_2} [Field F] {α w : ι → F} {mult : ι → ℕ} {d D : ℕ} {Q : Polynomial (Polynomial F)} [Fintype ι] [DecidableEq F] (hα : Function.Injective α) (hQ : IsWeightedInterpolant α w mult d D Q) {P : Polynomial F} (hP : P.natDegree ≤ d) (hagree : D < ∑ i : ι with Polynomial.eval (α i) P = w i, mult i) :

Weighted multiplicity root containment. With distinct points α, if P has natDegree ≤ d and D < ∑ i ∈ {i | P.eval (α i) = w i}, mult i, then Q.eval P = 0 for every weighted-multiplicity interpolant Q.

theorem Cslib.Code.GuruswamiSudan.IsWeightedInterpolant.X_sub_C_dvd {F : Type u_1} {ι : Type u_2} [Field F] {α w : ι → F} {mult : ι → ℕ} {d D : ℕ} {Q : Polynomial (Polynomial F)} [Fintype ι] [DecidableEq F] (hα : Function.Injective α) (hQ : IsWeightedInterpolant α w mult d D Q) {P : Polynomial F} (hP : P.natDegree ≤ d) (hagree : D < ∑ i : ι with Polynomial.eval (α i) P = w i, mult i) :

Under the hypotheses of IsWeightedInterpolant.eval_eq_zero, Y - C P divides Q.

theorem Cslib.Code.GuruswamiSudan.IsWeightedInterpolant.mem_roots {F : Type u_1} {ι : Type u_2} [Field F] {α w : ι → F} {mult : ι → ℕ} {d D : ℕ} {Q : Polynomial (Polynomial F)} [Fintype ι] [DecidableEq F] (hα : Function.Injective α) (hQ : IsWeightedInterpolant α w mult d D Q) {P : Polynomial F} (hP : P.natDegree ≤ d) (hagree : D < ∑ i : ι with Polynomial.eval (α i) P = w i, mult i) :

Under the hypotheses of IsWeightedInterpolant.eval_eq_zero, P is a root of Q.

theorem Cslib.Code.GuruswamiSudan.IsInterpolant.eval_eq_zero {F : Type u_1} {ι : Type u_2} [Field F] {α w : ι → F} {m d D : ℕ} {Q : Polynomial (Polynomial F)} [Fintype ι] [DecidableEq F] (hα : Function.Injective α) (hQ : IsInterpolant α w m d D Q) {P : Polynomial F} (hP : P.natDegree ≤ d) (hagree : D < m * {i : ι | Polynomial.eval (α i) P = w i}.card) :

Multiplicity root containment. With distinct points α, if P has natDegree ≤ d and D < m * #{i | P.eval (α i) = w i}, then Q.eval P = 0 for every multiplicity-m interpolant Q.

theorem Cslib.Code.GuruswamiSudan.IsInterpolant.X_sub_C_dvd {F : Type u_1} {ι : Type u_2} [Field F] {α w : ι → F} {m d D : ℕ} {Q : Polynomial (Polynomial F)} [Fintype ι] [DecidableEq F] (hα : Function.Injective α) (hQ : IsInterpolant α w m d D Q) {P : Polynomial F} (hP : P.natDegree ≤ d) (hagree : D < m * {i : ι | Polynomial.eval (α i) P = w i}.card) :

Multiplicity root divisibility. Under the hypotheses of IsInterpolant.eval_eq_zero, Y - C P divides every multiplicity-m interpolant Q.

theorem Cslib.Code.GuruswamiSudan.IsInterpolant.mem_roots {F : Type u_1} {ι : Type u_2} [Field F] {α w : ι → F} {m d D : ℕ} {Q : Polynomial (Polynomial F)} [Fintype ι] [DecidableEq F] (hα : Function.Injective α) (hQ : IsInterpolant α w m d D Q) {P : Polynomial F} (hP : P.natDegree ≤ d) (hagree : D < m * {i : ι | Polynomial.eval (α i) P = w i}.card) :

Under the hypotheses of IsInterpolant.eval_eq_zero, P is a root of Q in F[X][Y].

Explicit least-Y-degree multiplicity interpolant #

noncomputable def Cslib.Code.GuruswamiSudan.weightedInterpolant {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] (α w : ι → F) (mult : ι → ℕ) (d D : ℕ) :

An explicit weighted-multiplicity interpolant of least Y-degree, computed by Gaussian elimination via Sudan.minDegPoly.

@[reducible, inline]
noncomputable abbrev Cslib.Code.GuruswamiSudan.interpolant {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] (α w : ι → F) (m d D : ℕ) :

An explicit uniform multiplicity-m interpolant of least Y-degree, specializing weightedInterpolant to the constant multiplicity profile fun _ => m.

theorem Cslib.Code.GuruswamiSudan.weightedDegreeLE_weightedInterpolant {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] (α w : ι → F) (mult : ι → ℕ) (d D : ℕ) :

The elimination interpolant always has (1, d)-weighted degree at most D.

theorem Cslib.Code.GuruswamiSudan.natDegree_weightedInterpolant_le_bound {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] (α w : ι → F) (mult : ι → ℕ) (d D : ℕ) :

The elimination interpolant always has Y-degree at most D (for all d, including d = 0).

theorem Cslib.Code.GuruswamiSudan.vanishesToOrder_weightedInterpolant {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] (α w : ι → F) (mult : ι → ℕ) (d D : ℕ) (i : ι) :
Polynomial.Bivariate.VanishesToOrder (mult i) (α i) (w i) (weightedInterpolant α w mult d D)

The elimination interpolant always vanishes to order mult i at each (α i, w i) (including when no nonzero interpolant exists and it evaluates to 0).

theorem Cslib.Code.GuruswamiSudan.isWeightedInterpolant_weightedInterpolant {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] (α w : ι → F) {mult : ι → ℕ} {d D : ℕ} (hd : 1 ≤ d) (hn : ∑ i : ι, mult i * (mult i + 1) / 2 < (Sudan.monomials d D).card) :
IsWeightedInterpolant α w mult d D (weightedInterpolant α w mult d D)

The elimination interpolant is a weighted-multiplicity interpolant. For d ≥ 1 and strictly more monomials of (1, d)-weighted degree at most D than multiplicity constraints, weightedInterpolant α w mult d D satisfies IsWeightedInterpolant α w mult d D.

theorem Cslib.Code.GuruswamiSudan.natDegree_weightedInterpolant_le {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] (α w : ι → F) {mult : ι → ℕ} {d D : ℕ} (hd : 1 ≤ d) {Q : Polynomial (Polynomial F)} (hQ : IsWeightedInterpolant α w mult d D Q) :

The elimination interpolant has least Y-degree among all weighted-multiplicity interpolants (and in particular, for mult = fun _ => m, among all uniform multiplicity-m interpolants).

theorem Cslib.Code.GuruswamiSudan.isInterpolant_interpolant {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] (α w : ι → F) {m d D : ℕ} (hd : 1 ≤ d) (hn : Fintype.card ι * (m * (m + 1) / 2) < (Sudan.monomials d D).card) :
IsInterpolant α w m d D (interpolant α w m d D)

The uniform elimination interpolant is a multiplicity-m interpolant. For d ≥ 1 and strictly more monomials of (1, d)-weighted degree at most D than multiplicity-m constraints, interpolant α w m d D satisfies IsInterpolant α w m d D.

Guruswami–Sudan list decoder for Reed–Solomon codes #

noncomputable def Cslib.Code.guruswamiSudan {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] (α w : ι → F) (m k D : ℕ) :

Guruswami–Sudan list decoder [GS99b], [GuruswamiRudraSudan2019, Algorithm 12.2.3 (p. 256)] for Reed–Solomon codes of dimension k, multiplicity m, and (1, k - 1)-weighted degree bound D: the roots P in F[X] of the least-Y-degree multiplicity-m interpolant GuruswamiSudan.interpolant α w m (k - 1) D that have degree less than k and satisfy D < m * #{i | P.eval (α i) = w i}. Roots in F[X][Y] are taken noncomputably via Polynomial.roots.

theorem Cslib.Code.degree_lt_and_lt_mul_card_of_mem_guruswamiSudan {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] {α w : ι → F} {m k D : ℕ} {P : Polynomial F} (h : P ∈ guruswamiSudan α w m k D) :
P.degree < ↑k ∧ D < m * {i : ι | Polynomial.eval (α i) P = w i}.card

Every polynomial returned by guruswamiSudan has degree less than k and satisfies D < m * #{i | P.eval (α i) = w i}.

theorem Cslib.Code.card_guruswamiSudan_le_natDegree {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] {α w : ι → F} {m k D : ℕ} :

The list size of guruswamiSudan is at most the Y-degree of the elimination interpolant.

theorem Cslib.Code.card_guruswamiSudan_le {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] {α w : ι → F} {m k D : ℕ} :
(guruswamiSudan α w m k D).card ≤ D

The list size of guruswamiSudan is always at most D (including the case k = 1).

theorem Cslib.Code.card_guruswamiSudan_mul_le {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] {α w : ι → F} {m k D : ℕ} :
(guruswamiSudan α w m k D).card * (k - 1) ≤ D

List size of the Guruswami–Sudan decoder. The list size L satisfies L * (k - 1) ≤ D, so at most D / (k - 1) polynomials are returned when k ≥ 2.

theorem Cslib.Code.mem_guruswamiSudan_iff {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] {α w : ι → F} {m k D : ℕ} {P : Polynomial F} (hα : Function.Injective α) (hk : 2 ≤ k) (hn : Fintype.card ι * (m * (m + 1) / 2) < (Sudan.monomials (k - 1) D).card) :
P ∈ guruswamiSudan α w m k D ↔ P.degree < ↑k ∧ D < m * {i : ι | Polynomial.eval (α i) P = w i}.card

Completeness and soundness of Guruswami–Sudan list decoding. With distinct points α, k ≥ 2, and |ι| * (m * (m + 1) / 2) < #(Sudan.monomials (k - 1) D), the decoder lists exactly the polynomials of degree less than k with D < m * #{i | P.eval (α i) = w i}.

theorem Cslib.Code.mem_guruswamiSudan_iff_of_lt {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] {α w : ι → F} {m k D : ℕ} {P : Polynomial F} (hα : Function.Injective α) (hk : 2 ≤ k) (hn : Fintype.card ι * (k - 1) * m * (m + 1) < (D + 1) * (D + 2)) :
P ∈ guruswamiSudan α w m k D ↔ P.degree < ↑k ∧ D < m * {i : ι | Polynomial.eval (α i) P = w i}.card

Guruswami–Sudan list decoding [GS99b], [GuruswamiRudraSudan2019, Lemmas 12.2.10–11 (pp. 256–257)] under the closed-form condition |ι| * (k - 1) * m * (m + 1) < (D + 1) * (D + 2).

theorem Cslib.Code.exists_mem_guruswamiSudan_of_mem_reedSolomon {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] {α w : ι → F} {m k D : ℕ} (hα : Function.Injective α) (hk : 2 ≤ k) (hn : Fintype.card ι * (k - 1) * m * (m + 1) < (D + 1) * (D + 2)) {c : ι → F} (hc : c ∈ reedSolomon α k) (hagree : D < m * {i : ι | c i = w i}.card) :
∃ P ∈ guruswamiSudan α w m k D, (fun (i : ι) => Polynomial.eval (α i) P) = c

Every Reed–Solomon codeword agreeing with w at more than D / m points is decoded by guruswamiSudan.

List decoding up to the full Johnson radius #

theorem Cslib.Code.guruswamiSudan_johnson_ineq {n d t : ℕ} (ht : n * d < t ^ 2) :
have m := n * d / (t ^ 2 - n * d) + 1; have D := m * t - 1; 1 ≤ m ∧ D + 1 = m * t ∧ n * d * m * (m + 1) < (D + 1) * (D + 2)

Exact integer Johnson-bound parameter choice: whenever n * d < t ^ 2, choosing m = n * d / (t ^ 2 - n * d) + 1 and D = m * t - 1 satisfies the Guruswami–Sudan interpolation inequality n * d * m * (m + 1) < (D + 1) * (D + 2).

theorem Cslib.Code.mem_guruswamiSudan_johnson_iff {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] {α w : ι → F} {k : ℕ} {P : Polynomial F} (hα : Function.Injective α) (hk : 2 ≤ k) {e : ℕ} (he : Fintype.card ι * (k - 1) < (Fintype.card ι - e) ^ 2) :
have n := Fintype.card ι; have m := n * (k - 1) / ((n - e) ^ 2 - n * (k - 1)) + 1; have D := m * (n - e) - 1; P ∈ guruswamiSudan α w m k D ↔ P.degree < ↑k ∧ hammingDist (fun (i : ι) => Polynomial.eval (α i) P) w ≤ e

Guruswami–Sudan list decoding up to the exact integer Johnson radius [GS99b], [GuruswamiRudraSudan2019, Theorem 12.2.12 (pp. 257–259)]. With distinct points α, k ≥ 2, and n * (k - 1) < (n - e) ^ 2 (equivalently e < n - √(n * (k - 1))), choosing m = n * (k - 1) / ((n - e) ^ 2 - n * (k - 1)) + 1 and D = m * (n - e) - 1, guruswamiSudan α w m k D lists exactly the polynomials of degree less than k whose codeword is within Hamming distance e of w.

theorem Cslib.Code.exists_guruswamiSudan_of_eps {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] {α : ι → F} {k : ℕ} [Nonempty ι] (hα : Function.Injective α) (hk : 2 ≤ k) (hkn : k ≤ Fintype.card ι) {ε : ℝ} (hε : 0 < ε) :
∃ (m : ℕ) (D : ℕ), 1 ≤ m ∧ m ≤ ⌊1 / (2 * ε)⌋₊ + 1 ∧ D < m * Fintype.card ι ∧ ∀ (w : ι → F), (guruswamiSudan α w m k D).card * (k - 1) ≤ D ∧ ∀ (P : Polynomial F), P.degree < ↑k → ↑(hammingDist (fun (i : ι) => Polynomial.eval (α i) P) w) ≤ (1 - √(↑k / ↑(Fintype.card ι)) - ε) * ↑(Fintype.card ι) → P ∈ guruswamiSudan α w m k D

Asymptotic / real Johnson-bound corollary [GS99b], [GuruswamiRudraSudan2019, Theorem 12.2.12 (pp. 257–259)]. For any nonempty set of n distinct evaluation points α, dimension 2 ≤ k ≤ n, and any ε > 0, there exist multiplicity m (bounded by ⌊1 / (2 * ε)⌋₊ + 1, independent of n and k) and weighted degree D < m * n such that for every received word w, guruswamiSudan α w m k D recovers every polynomial P of degree less than k within relative Hamming distance 1 - √(k / n) - ε, with list size bounded by D / (k - 1) (in particular #(guruswamiSudan α w m k D) ≤ (1 / (2 * ε) + 1) / ((k - 1) / n)).