Skip to content

Guruswami-Sudan divisibility#300

Open
ster-oc wants to merge 14 commits intoVerified-zkEVM:mainfrom
ster-oc:guruswami-sudan-prop
Open

Guruswami-Sudan divisibility#300
ster-oc wants to merge 14 commits intoVerified-zkEVM:mainfrom
ster-oc:guruswami-sudan-prop

Conversation

@ster-oc
Copy link

@ster-oc ster-oc commented Jan 31, 2026

In this PR with @Aristotle-Harmonic, we prove the divisibility property for a bivariate polynomial fulfilling Guruswami-Sudan set of conditions. There is an arithmetical lemma left to prove, which will be there soon.
A bit of golfing and refactor will follow shortly!

Depends on : #299
Closes : #224

ster-oc and others added 4 commits January 31, 2026 09:27
Co-authored-by: Aristotle (Harmonic) <aristotle-harmonic@harmonic.fun>
Co-authored-by: Aristotle (Harmonic) <aristotle-harmonic@harmonic.fun>
@github-actions
Copy link

github-actions bot commented Jan 31, 2026

🤖 Gemini PR Summary

This Pull Request implements the divisibility property for the Guruswami-Sudan list decoding algorithm, a critical component for Reed-Solomon code verification. The work establishes the formal existence of interpolation polynomials and refines how bivariate root multiplicity is handled within the library.

Features

  • Guruswami-Sudan Implementation: Introduced the formal implementation of the Guruswami-Sudan list decoding algorithm, including proofs for the existence of bivariate interpolation polynomials.
  • Divisibility Property: Proved that codewords within the specified decoding radius are roots of the interpolation polynomial (the "divisibility property").
  • Bivariate Polynomial Enhancements: Redefined root multiplicity for bivariate polynomials using the "order of vanishing" (minimum total degree of nonzero coefficients after shifting) and added shifting helper functions.
  • List Utilities: Added a new lemma to Data.List.Lemmas regarding the lower bounds of minimum values in lists produced via filterMap.

Refactoring

  • Module Reorganization: Decoupled core Guruswami-Sudan definitions into a dedicated Basic module to improve maintainability and build logic.
  • Predicate Renaming: Updated the Condition predicate to Conditions within the Proximity Gap lemmas (BCIKS20.lean) for better naming consistency.
  • Top-level Imports: Updated ArkLib.lean to include the new Guruswami-Sudan modules.

Maintenance

  • Dependency Update: Updated the lake-manifest.json to track a newer revision of the VCVio dependency.

Notes for Reviewers:


Analysis of Changes

Metric Count
📝 Files Changed 7
Lines Added 1018
Lines Removed 80

sorry Tracking

✅ **Removed:** 2 `sorry`(s)
  • lemma guruswami_sudan_for_proximity_gap_existence {k m : ℕ} {ωs : Fin n ↪ F} {f : Fin n → F} : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma guruswami_sudan_for_proximity_gap_property {k m : ℕ} {ωs : Fin n ↪ F} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean

🎨 **Style Guide Adherence**

The following code changes violate the ArkLib style guide:

ArkLib/Data/CodingTheory/GuruswamiSudan/Basic.lean

  • Line 34: noncomputable def proximity_gap_degree_bound : ℕ :=
    • Violation: "Functions and Terms: lowerCamelCase (e.g., binarySearch, isPrime)."
  • Line 41: noncomputable def proximity_gap_johnson : ℝ :=
    • Violation: "Functions and Terms: lowerCamelCase (e.g., binarySearch, isPrime)."
  • Line 60: def weigthBoundIndices (k D : ℕ) : Finset (ℕ × ℕ) :=
    • Violation: "Spelling: Use American English for declaration names (e.g., analyze not analyse, color not colour)." (Note: Spelling error "weigth").
  • Line 66: lemma card_weigthBoundIndices_eq_sum (D : ℕ) (hk : 1 < k) :
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)." (Contains camelCase segments and spelling error).
  • Line 304: lemma coeff_linearCombination_monomial (c : ℕ × ℕ →₀ F) (i j : ℕ) :
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
  • Line 313: lemma linearIndependent_monomials :
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
  • Line 333: lemma natWeightedDegree_monomial (i j u v : ℕ) :
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
  • Line 345: lemma natWeightedDegree_monomial_eq (i j u v : ℕ) :
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
  • Line 349: lemma natWeightedDegree_add_le (p q : F[X][Y]) (u v : ℕ) :
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
  • Line 368: lemma natWeightedDegree_sum_le {ι : Type*} (s : Finset ι) (f : ι → F[X][Y]) (u v : ℕ) :
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
  • Line 383: lemma natWeightedDegree_smul_le {F : Type} [Semiring F] (a : F) (p : F[X][Y]) (u v : ℕ) :
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
  • Line 394: lemma natWeightedDegree_coeffsToPoly_le (k D : ℕ) (c : (weigthBoundIndices k D) → F) :
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
  • Line 466: lemma rootMultiplicity_le_of_coeff_ne_zero [DecidableEq F] {Q : F[X][Y]} {x y : F} {s t : ℕ}
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
  • Line 505: lemma rootMultiplicity_ge_of_shift_zero [DecidableEq F] {f : F[X][Y]} {x y : F}
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
  • Line 568: lemma degree_eval_le_weightedDegree (Q : F[X][Y]) (P : F[X]) (k : ℕ) (hP : P.natDegree ≤ k - 1) :
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
  • Line 585: lemma dvd_eval_of_rootMultiplicity_zero (Q : F[X][Y]) (P : F[X]) (m : ℕ)
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
  • Line 610: def HasOrderAt (Q : F[X][Y]) (x y : F) (m : ℕ) : Prop :=
    • Violation: "Functions and Terms: lowerCamelCase (e.g., binarySearch, isPrime)."
  • Line 613: lemma orderAt_eval_ge (Q : F[X][Y]) (P : F[X]) (x : F) (m : ℕ)
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
  • Line 672: lemma codewordToPoly_degree_le (hk : k + 1 ≤ n) (p : code ωs k) :
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."

ArkLib/Data/Polynomial/Bivariate.lean

  • Line 103: lemma weightedDegree_ne_none {F : Type} [Semiring F] (f : F[X][Y]) (u v : ℕ) :
    • Violation: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
  • Line 380: map_smul' r x := by simp; rw[smul_monomial]; aesop
    • Violation: "We aim to adhere to the Lean community's contribution guidelines." (Specifically: missing space after rw and avoid using ; to separate tactics).
  • Line 390: rw[smul_monomial, smul_monomial]
    • Violation: "We aim to adhere to the Lean community's contribution guidelines." (Specifically: missing space after rw).

📄 **Per-File Summaries**
  • ArkLib.lean: Added the GuruswamiSudan.Basic module to the library's top-level imports.
  • ArkLib/Data/CodingTheory/GuruswamiSudan/Basic.lean: This file provides the formal implementation of the Guruswami-Sudan list decoding algorithm for Reed-Solomon codes, establishing the existence of a bivariate interpolation polynomial and proving that codewords within the decoding radius are roots of this polynomial.
  • ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean: Refactor the Guruswami-Sudan implementation by moving core definitions to a dedicated module and updating the existence and divisibility theorems for the proximity gap.
  • ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean: Rename the Condition predicate to Conditions in the Guruswami-Sudan proximity gap lemmas.
  • ArkLib/Data/List/Lemmas.lean: Adds a lemma proving that if all elements produced by filterMap satisfy a lower bound, then the minimum of the resulting list also satisfies that bound.
  • ArkLib/Data/Polynomial/Bivariate.lean: This update redefines bivariate root multiplicity as the order of vanishing (the minimum total degree of nonzero coefficients after shifting) and introduces a helper function for shifting polynomials.
  • lake-manifest.json: Updates the revision hash for the VCVio dependency.

Last updated: 2026-02-14 20:27 UTC.

@ster-oc ster-oc marked this pull request as draft January 31, 2026 23:16
@ster-oc
Copy link
Author

ster-oc commented Feb 5, 2026

I see a problem with the definition of proximity_gap_johnson.
In particular, I believe that in Lemma 5.3 of [BCIKS20] the second part of the statement really asks to bound the Hamming distance with the real number δ₀(ρ, m) and not with its floor as per the definition in GuruswamiSudan.lean.

The relative radius δ₀(ρ, m) is always <1, which means that its floor is always 0.
This means that in [BCIKS20] Δ is the relative Hamming distance and not the absolute one

@alexanderlhicks
Copy link
Collaborator

Hello! Thanks for the PR and sorry for the delay in getting to this. I'll be merging the 4.26 PR soon, which might break a few things, and get back to all the other PRs including this one.

@ster-oc ster-oc marked this pull request as ready for review February 14, 2026 12:47
@ster-oc
Copy link
Author

ster-oc commented Feb 14, 2026

I realized that the definition of rootMultiplicity₀ was not correct, with essentially a List.max? to be replaced by a List.min?.
(An example is the polynomial p(x) := X + Y² which has a zero of order 1 at (0,0), but List.max would give order 2 because of the monomial )

This fix together with the correct hypothesis on the relative Hamming distance should now be fine for everything to go through.

There is still a sorry left because some code broke after changing rootMultiplicity.

Co-authored-by: Aristotle (Harmonic) <aristotle-harmonic@harmonic.fun>
@ster-oc
Copy link
Author

ster-oc commented Feb 14, 2026

Guruswami-Sudan is now sorry free!

I see you opened PR #306, be mindful that I put some of the new definitions in Bivariate.lean✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proof obligation for guruswami_sudan_for_proximity_gap_property in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean

2 participants

Comments