Skip to content

Coding theory proofs#298

Open
FawadHa1der wants to merge 14 commits intoVerified-zkEVM:mainfrom
FawadHa1der:BCIKS20
Open

Coding theory proofs#298
FawadHa1der wants to merge 14 commits intoVerified-zkEVM:mainfrom
FawadHa1der:BCIKS20

Conversation

@FawadHa1der
Copy link

Enabled by Codex 5.2. This is an attempt to provide all/majority of the proofs marked as sorry. For proximity gap related lemmas in BCIKS20.lean there have been some assumptions added which require proper review from the experts. @katyhr saw your talk on Coding Theory implementation recently, may be this helps in that regard.

@alexanderlhicks I know there is a refactor going on but I hope some of the proofs here are useful, and I open to doing smaller PRs for the proofs which are clean without any assumptions added.

@chung-thai-nguyen here another PR related to coding theory that you might want to review. I do hope some if not all the proofs are useful.

Please give any feedback or modifications necessary.

Thank you!

@github-actions
Copy link

github-actions bot commented Jan 30, 2026

🤖 Gemini PR Summary

Completes numerous sorry stubs to formalize algebraic coding theory and proximity gap results within the ArkLib library. This work bridges foundational polynomial algebra with high-level cryptographic primitives used in modern proof systems like STARKs.

Mathematical Formalization

1. Decoding Algorithms

  • Guruswami–Sudan (GS): Formalizes the list-decoding algorithm, including bivariate interpolant existence, decoding correctness, and list size bounds.
  • Berlekamp–Welch (BW): Completes the linsolve implementation and verifies unique decoding correctness theorems.

2. Proximity Gaps and Correlated Agreement

  • BCIKS20 & AHIV22: Provides rigorous proofs for interleaved Reed-Solomon code lemmas, covering global consistency logic and list recovery techniques.
  • DG25 Refactor: Refines Reed-Solomon proximity gap theorems to include explicit hypotheses for correlated agreement on affine lines.
  • List Recovery: Establishes foundational lemmas for polynomial interpolation and curve evaluation to support the BCIKS20 framework.

3. Bivariate Polynomials and Resultants

  • Resultants and Discriminants: Implements bivariate polynomial resultants and Sylvester matrices, proving degree bounds and root relationships.
  • Bivariate Properties: Formalizes multiplicativity of total degrees and root multiplicity implications essential for the GS algorithm.
  • Rational Functions & Function Fields: Constructs the function field $\mathbb{L}$, the ring of regular elements $\mathcal{O}$, and Hensel-lift power series $\gamma$ to support [BCIKS20] arguments.

Infrastructure and Library Integration

  • Module Updates: Expands ArkLib.lean with new ListRecovery and RationalFunctionsInfrastructure modules.
  • Hypothesis Refinement: Replaces generic stubs in BCIKS20.lean and DG25.lean with specific, reviewable assumptions regarding affine lines and correlated agreement.

Important

Reviewer Note: New assumptions added to BCIKS20.lean require expert verification to ensure alignment with intended cryptographic security models.


Analysis of Changes

Metric Count
📝 Files Changed 11
Lines Added 13520
Lines Removed 914

Lean Declarations

✏️ **Removed:** 36 declaration(s)
  • lemma exists_factors_with_large_common_root_set in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • def D_Y (Q : F[Z][X][Y]) : ℕ in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma approximate_solution_is_exact_solution_coeffs in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem weighted_correlated_agreement_for_parameterized_curves' in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma irreducible_factorization_of_gs_solution in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem weighted_correlated_agreement_over_affine_spaces in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • def α (x₀ : F) (R : F[X][X][Y]) (H : F[X][Y]) [φ : Fact (Irreducible H)] (t : ℕ) : 𝕃 H in ArkLib/Data/Polynomial/RationalFunctions.lean
  • def β (R : F[X][X][Y]) (t : ℕ) : 𝒪 H in ArkLib/Data/Polynomial/RationalFunctions.lean
  • theorem large_agreement_set_on_curve_implies_correlated_agreement' {l : ℕ} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem average_proximity_implies_proximity_of_linear_subspace [DecidableEq ι] [DecidableEq F] in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma exists_a_set_and_a_matching_polynomial in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • def rootMultiplicity₀.{u} {F : Type u} [Semiring F] [DecidableEq F] (f : F[X][Y]) : Option ℕ in ArkLib/Data/Polynomial/Bivariate.lean
  • lemma modified_guruswami_has_a_solution in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma exists_points_with_large_matching_subset in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • opaque linsolve (A : Matrix (Fin n) (Fin m) F) (b : Fin n → F) : Option (Fin m → F) in ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean
  • def D_YZ (Q : F[Z][X][Y]) : ℕ in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • def ζ (R : F[X][X][Y]) (x₀ : F) (H : F[X][Y]) [H_irreducible : Fact (Irreducible H)] : 𝕃 H in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma separable_iff_discr_eq_zero {F : Type} [Field F] [Inhabited F] (f : F[X]) : in ArkLib/Data/Polynomial/Prelims.lean
  • theorem weighted_correlated_agreement_for_parameterized_curves in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma matching_set_is_a_sub_of_coeffs_of_close_proximity in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma exists_Pz_of_coeffs_of_close_proximity in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • def γ' (x₀ : F) (R : F[X][X][Y]) (H_irreducible : Irreducible H) : PowerSeries (𝕃 H) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • opaque decoder (k r D e : ℕ) (ωs : Fin n ↪ F) (f : Fin n → F) : List F[X] in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma discr_of_irred_components_nonzero in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • def α' (x₀ : F) (R : F[X][X][Y]) (H_irreducible : Irreducible H) (t : ℕ) : 𝕃 H in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma irreducible_H in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem proximity_gap_RSCodes {k t : ℕ} [NeZero k] [NeZero t] {deg : ℕ} {domain : ι ↪ F} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • def γ (x₀ : F) (R : F[X][X][Y]) (H : F[X][Y]) [φ : Fact (Irreducible H)] : PowerSeries (𝕃 H) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma solution_gamma_is_linear_in_Z in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma solution_gamma_matches_word_if_subset_large in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem large_agreement_set_on_curve_implies_correlated_agreement {l : ℕ} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma gamma_eq_P in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • def ξ (x₀ : F) (R : F[X][X][Y]) (H : F[X][Y]) [φ : Fact (Irreducible H)] : 𝒪 H in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma approximate_solution_is_exact_solution_coeffs' in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem weighted_correlated_agreement_over_affine_spaces' in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • def curve {l : ℕ} (u : Fin l → Fin n → F) (z : F) : Fin n → F in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
✏️ **Added:** 171 declaration(s)
  • lemma resultantY_def (P Q : F[X][Y]) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma exists_fiber_card_gt_of_card_gt_mul {α β : Type*} [Fintype α] [Fintype β] [DecidableEq β] in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma numberOfClosePts_eq_natCard (u v : ι → F) (deg : ℕ) (α : ι ↪ F) (e : ℕ) : in ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean
  • lemma nat_cast_sub_eq_cast_pred {k : ℕ} [NeZero k] (hk : k ≤ n) : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma sum_sigma_sub_eq_mul {n m : ℕ} (σ : Equiv.Perm (Fin (n + m))) in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma sum_range_add_eq_sum_range_of_forall_ge (f : ℕ → R) (n t : ℕ) in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma natDegree_eval_le_natWeightedDegree (Q : Polynomial (Polynomial F)) {k : ℕ} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • theorem divides_of_close_of_roots {k D e : ℕ} [NeZero k] {ωs : Fin n ↪ F} {f : Fin n → F} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma curveEval_injective in ArkLib/Data/CodingTheory/ProximityGap/ListRecovery.lean
  • lemma eval_mem_reedSolomon_code_of_mem_messagePolynomials {k : ℕ} [NeZero k] {ωs : Fin n ↪ F} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma proximity_gap_count_bound {k m : ℕ} (hk : 2 ≤ k) : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma α_eq_closedForm (x₀ : F) (R : F[X][X][Y]) (H : F[X][Y]) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • def multiplicityPairsRowEmbedding (a : ℕ) : ℕ ↪ ℕ × ℕ in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma shiftAt_coeff_zero_eq_eval (Q : F[X][Y]) (x y : F) : in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma eq_zero_of_card_lt_roots {F : Type*} [Field F] [DecidableEq F] {p : F[X]} {s : Finset F} in ArkLib/Data/CodingTheory/ProximityGap/ListRecovery.lean
  • lemma sylvester_mulVec_eq_coeff_add in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • theorem H_tilde'_map_explicit (H : F[X][Y]) : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma eval_eval_eq_eval₂_evalRingHom (Q : Polynomial (Polynomial F)) (p : F[X]) (x : F) : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma proximity_gap_degree_bound_lt_mul {k m : ℕ} [NeZero n] [NeZero m] in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma coeff_polyOfVec_ge {n : ℕ} (v : Fin n → R) {i : ℕ} (hi : n ≤ i) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • theorem RS_correlatedAgreement_affineLines_uniqueDecodingRegime_closeToCode_heHalf in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma natDegree_sylvester_entry_le (P Q : F[X][Y]) (m n : ℕ) in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • def rootMultiplicity₀ {F : Type*} [Semiring F] [DecidableEq F] (f : F[X][Y]) : Option ℕ in ArkLib/Data/Polynomial/Bivariate.lean
  • def affineEval {k : ℕ} (u : Fin (k + 1) → ι → F) (t : Fin k → F) (x : ι) : F in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma list_size_le_degree_bound_of_GSCondition in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma exists_codeword_with_large_fiber_of_closeToCode in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma coeff_γ (x₀ : F) (R : F[X][X][Y]) (H : F[X][Y]) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma proximity_gap_list_size_bound {k m : ℕ} [Fintype F] [NeZero n] [NeZero m] in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma resultant_eq_zero_of_common_root_eval in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma m_mul_m_add_one_mul_lt (m k : ℕ) : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma natDegree_resultantY_le_weight in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma list_size_le_degree_bound_of_GSCondition_of_two_le in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • theorem correlatedAgreement_affine_curves_of_globalConsistency [DecidableEq ι] in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma card_linear_factors_le_degreeY {P : Finset F[X]} {Q : F[X][Y]} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma curveGlobalConsistency_of_listRecoveryBound_one in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma pi_z_apply_out {H : F[X][Y]} (z : F) (root : rationalRoot (H_tilde' H) z) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma eq_zero_of_card_lt_roots {p : F[X]} {s : Finset F} in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma γ_eq_mk_alpha (x₀ : F) (R : F[X][X][Y]) (H : F[X][Y]) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma natDegree_coeff_le_degreeX (f : F[X][Y]) (i : ℕ) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • def AffineSpaceGlobalConsistency in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem H_tilde_eq_sum_range (H : F[X][Y]) : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma affine_solution_card_le {k : ℕ} {u v : Fin (k + 1) → ι → F} {x : ι} {i0 : Fin k} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem correlatedAgreement_affine_curves_counting [DecidableEq ι] {k : ℕ} {u : Fin k → ι → F} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma dirClose_of_manyClosePts in ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean
  • lemma card_filter_gt_floor_of_prob_gt' {α : Type} [Fintype α] [DecidableEq α] [Nonempty α] in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma list_size_le_degreeY_of_GSCondition in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma shiftAt_eval_eq_comp_eval (Q : Polynomial (Polynomial F)) (p : F[X]) (x y : F) : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • theorem proximity_gap_RSCodes_split {k t : ℕ} {deg : ℕ} {domain : ι ↪ F} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma sylvester_mulVec_eq_zero_of_common_root' in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma eval_eval_C_eq_eval₂_evalRingHom (Q : Polynomial (Polynomial F)) (a x : F) : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma eval_injective_of_natDegree_lt {k : ℕ} [NeZero k] (hk : k ≤ n) {ωs : Fin n ↪ F} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • theorem RS_correlatedAgreement_affineLines_uniqueDecodingRegime_closeToCode_of_prob_heHalf in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • def multiplicityPairsRow (m a : ℕ) : Finset (ℕ × ℕ) in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • theorem exists_nonzero_interpolant_mul {k D m : ℕ} [NeZero k] (hk : 2 ≤ k) {ωs : Fin n ↪ F} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • def monomials (k D : ℕ) : Finset (ℕ × ℕ) in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • theorem irreducible_comp_C_mul_X_iff {K : Type} [Field K] (a : K) (ha : a ≠ 0) (p : K[X]) : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma resultant_eq_zero_of_common_root_eval' in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • theorem proximity_gap_RSCodes_affineLines_uniqueDecoding_branch in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma mem_affineSpan_range_iff_mem_affineSubspaceAtOrigin in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem decoder_length_le_johnson_bound {k r D e : ℕ} [NeZero k] (hk : k ≤ n) [NeZero n] in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma floor_div_mul_card_eq (N : ℕ) : in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma sylvester_map (p q : R[X]) (m n : ℕ) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma curveGlobalConsistency_of_listRecoveryBound in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem H_tilde'_monic (H : F[X][Y]) : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma eval₂_coeffAsRatFunc_X (p : F[X][Y]) : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma card_multiplicityPairs (m : ℕ) : (multiplicityPairs m).card = m * (m + 1) / 2 in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma resultant_eq_zero_of_common_root in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • example [Nonempty ι] [DecidableEq ι] {deg : ℕ} [NeZero deg] (hdeg : deg ≤ Fintype.card ι) in ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean
  • lemma resultant_map (p q : R[X]) (m n : ℕ) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma monomials_eq_disjiUnion (k D : ℕ) : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma card_filter_gt_floor_of_prob_gt {P : F → Prop} [DecidablePred P] [Nonempty F] {ε : ℝ≥0} : in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma messagePolynomials_mem_const_zero [Fintype F] {p : Polynomial F} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • theorem irreducible_map_univPolyHom_of_irreducible in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma errorBound_eq_ε_affineLines_factorFree_of_mem_uniqueDecoding in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma sum_perm_apply_eq_sum {n : ℕ} (σ : Equiv.Perm (Fin n)) (f : Fin n → ℕ) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma natAdd_le_iff {m n : ℕ} {i : Fin n} {j : Fin (m + n)} : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma shiftAt_eval_eq_comp_eval (Q : Polynomial (Polynomial F)) (p : F[X]) (x y : F) : in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma natDegree_lt_of_mem_messagePolynomials {k : ℕ} [NeZero k] {p : F[X]} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma resultant_eq_zero_of_common_root' in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma exists_pair_with_large_fiber_of_exists_close in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma messagePolynomials_mem_const_one [Fintype F] {p : Polynomial F} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma curve_coeff_eq_of_agree_on in ArkLib/Data/CodingTheory/ProximityGap/ListRecovery.lean
  • lemma exists_polynomial_curve_through_values_in_submodule in ArkLib/Data/CodingTheory/ProximityGap/ListRecovery.lean
  • lemma sufficiently_large_list_agreement_on_affine_space_implies_correlated_agreement in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma natWeightedDegree_polyOfCoeffs_le {k D : ℕ} [NeZero k] in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma exists_finset_of_prob_gt' {α : Type} [Fintype α] [DecidableEq α] [Nonempty α] in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem pi_z_lift_vanishes_on_span {H : F[X][Y]} (z : F) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma list_agreement_on_affine_space_implies_correlated_agreement_bound in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma coeff_γTrunc_eq_zero_of_le (x₀ : F) (R : F[X][X][Y]) (H : F[X][Y]) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • def curveEval in ArkLib/Data/CodingTheory/ProximityGap/ListRecovery.lean
  • lemma affineSpaceGlobalConsistency_of_listRecoveryBound_one in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem correlatedAgreement_affine_spaces_of_globalConsistency in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma mem_multiplicityPairs_of_add_lt {m a b : ℕ} (h : a + b < m) : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma all_points_close_of_jointAgreement_affineSubspace in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma exists_curve_with_large_fiber_of_candidateSet in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma monomialCount_eq_sum (k D : ℕ) : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma coeff_eq_zero_of_add_lt {p : R[X]} {x i : ℕ} (hx : x ≤ i) (h : x + p.natDegree < i) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma joinCoeffVec_polyOfVec {m n : ℕ} (v : Fin (n + m) → R) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • abbrev GSCondition in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma coeff_γTrunc_succ_self (x₀ : F) (R : F[X][X][Y]) (H : F[X][Y]) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma exists_affine_space_with_large_fiber_of_candidateSet in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem RS_correlatedAgreement_affineLines_uniqueDecodingRegime_closeToCode in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem pi_z_lift_H_tilde'_eq_zero {H : F[X][Y]} (z : F) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma card_curves_le_prod_lists in ArkLib/Data/CodingTheory/ProximityGap/ListRecovery.lean
  • lemma coeff_polyOfVec_lt {n : ℕ} (v : Fin n → R) {i : ℕ} (hi : i < n) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma proximity_gap_johnson_nat_eq (k m : ℕ) : in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem RS_correlatedAgreement_affineLines_uniqueDecodingRegime_of_prob in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem correlatedAgreement_affine_curves_of_listRecoveryBound_one [DecidableEq ι] in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem divides_of_close_of_vanish {k m D e : ℕ} [NeZero k] {ωs : Fin n ↪ F} {f : Fin n → F} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma not_linearIndependent_cols_of_mulVec_eq_zero in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma sylvester_mulVec_eq_zero_of_common_root in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • theorem decoder_length_le_reedSolomon_ball {k r D e : ℕ} [NeZero k] (hk : k ≤ n) {ωs : Fin n ↪ F} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • def multiplicityPairs (m : ℕ) : Finset (ℕ × ℕ) in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma specializeX_apply (z : F) (P : F[X][Y]) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma pow_X_sub_C_dvd_eval_of_vanish {m : ℕ} {Q : F[X][Y]} {x y : F} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma floor_div_mul_card_eq' {α : Type*} [Fintype α] [Nonempty α] (N : ℕ) : in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem RS_correlatedAgreement_affineLines_uniqueDecodingRegime_closeToCode_of_prob_errorBound in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma affineEval_eq_iff {k : ℕ} {u v : Fin (k + 1) → ι → F} (t : Fin k → F) (x : ι) : in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • def monomialRow (k D j : ℕ) : Finset (ℕ × ℕ) in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma canonicalRepOf𝒪_sub_out_mem_span {H : F[X][Y]} (β : 𝒪 H) : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma exists_finset_of_prob_gt {P : F → Prop} [DecidablePred P] [Nonempty F] {ε : ℝ≥0} : in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem correlatedAgreement_affine_spaces_counting {k : ℕ} {u : Fin (k + 1) → ι → F} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma sum_range_sub (m : ℕ) : (∑ a ∈ Finset.range m, (m - a)) = m * (m + 1) / 2 in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma castAdd_le_iff {m n : ℕ} {i : Fin m} {j : Fin (m + n)} : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma natDegree_polyOfVec_lt {n : ℕ} (v : Fin n → R) (hn : n ≠ 0) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma X_sub_C_dvd_of_eval_eq_zero {p : F[X]} {t : F} (ht : p.eval t = 0) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma polyOfCoeffs_ne_zero_of_coeff_ne_zero {k D : ℕ} {c : monomials (k in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma resultantY_eval (P Q : F[X][Y]) (z : F) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • def monomialCount (k D : ℕ) : ℕ in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • theorem proximity_gap_RSCodes_affineLines_uniqueDecoding_dichotomy in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma pi_z_apply_canonicalRep {H : F[X][Y]} (z : F) (root : rationalRoot (H_tilde' H) z) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • theorem correlatedAgreement_affine_spaces_of_listRecoveryBound_one {k : ℕ} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma exists_polynomial_curve_through_values in ArkLib/Data/CodingTheory/ProximityGap/ListRecovery.lean
  • lemma exists_bezout_of_resultant_eq_zero {f g : R[X]} in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • theorem univPolyHom_injective : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma polyOfCoeffs_eval_at (k D : ℕ) (ωs : Fin n ↪ F) (f : Fin n → F) in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • -- constant term equals evaluation at 0 (twice) in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • def CurveGlobalConsistency in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma natDegree_resultantY_le_max (P Q : F[X][Y]) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • theorem C_mul_X_div_C {w : RatFunc F} (hw : w ≠ 0) : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma agree_uniform_ge_one_sub_of_hamming_le in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma mu_set_uniform_eq (ι' : Finset ι) : in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma separable_iff_coprime_derivative {F : Type} [Field F] (f : F[X]) : in ArkLib/Data/Polynomial/Prelims.lean
  • theorem canonicalRepOf𝒪_zero in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma card_multiplicityPairs_cast (m : ℕ) : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma monomialCount_ge_sq {k D : ℕ} (hk : 2 ≤ k) : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • instance from a singleton-bounded list-recovery hypothesis. -/ in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma multiplicityPairs_eq_disjiUnion (m : ℕ) : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma sum_univ_add_castAdd_natAdd {a b : ℕ} (f : Fin (a + b) → ℕ) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma e_leq_dist_over_3_strong in ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean
  • lemma natDegreeY_le_natWeightedDegree {k : ℕ} (hk : 2 ≤ k) {Q : F[X][Y]} : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • def CurveListRecoveryBound in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma affineEval_sub_eq {k : ℕ} {u v : Fin (k + 1) → ι → F} (t : Fin k → F) (x : ι) : in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • def AffineSpaceListRecoveryBound in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma affineSpaceGlobalConsistency_of_listRecoveryBound in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem RS_correlatedAgreement_affineLines_uniqueDecodingRegime_closeToCode_of_prob in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma proximity_gap_b_le_degree_bound_add_one (k m : ℕ) : in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma proximity_gap_degree_bound_eq (k m : ℕ) : in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem pi_z_lift_span_le_ker {H : F[X][Y]} (z : F) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • theorem exists_nonzero_interpolant {k D : ℕ} [NeZero k] (hk : 2 ≤ k) {ωs : Fin n ↪ F} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • theorem H_tilde_eq_explicit (H : F[X][Y]) (hdeg : 0 < H.natDegree) : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma sylvester_mulVec_eq_coeff_add' in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma sum_range_if_le (n k : ℕ) (f : ℕ → R) : in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • lemma resultantY_eval_eq_zero_of_Sβ {H : F[X][Y]} [Fact (0 < H.natDegree)] in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma natDegree_det_le_of_entries {n : Type} [Fintype n] [DecidableEq n] in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean
  • theorem embeddingOf𝒪Into𝕃_ideal_le (H : F[X][Y]) (hdeg : 0 < H.natDegree) : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • theorem H_tilde_eq_explicit_forward (H : F[X][Y]) (hdeg : 0 < H.natDegree) : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • def monomialRowEmbedding (j : ℕ) : ℕ ↪ ℕ × ℕ in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • theorem H_tilde'_tail_degree_lt (H : F[X][Y]) : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • theorem bivPolyHom_HTilde'_eq_HTilde (H : F[X][Y]) (hdeg : 0 < H.natDegree) : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma proximity_gap_list_size_bound {k m : ℕ} [Fintype F] [NeZero n] [NeZero m] in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
✏️ **Affected:** 22 declaration(s) (line number changed)
  • lemma e_leq_dist_over_3 in ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean moved from L72 to L928
  • theorem RS_correlatedAgreement_affineLines {deg : ℕ} {domain : ι ↪ F} {δ : ℝ≥0} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean moved from L96 to L3642
  • theorem RS_correlatedAgreement_affineLines_uniqueDecodingRegime in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean moved from L84 to L3456
  • def regularElms (H : F[X][Y]) [Fact (0 < H.natDegree)] : Type in ArkLib/Data/Polynomial/RationalFunctions.lean moved from L116 to L400
  • theorem correlatedAgreement_affine_spaces {k : ℕ} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean moved from L134 to L4787
  • def regularElms_set (H : F[X][Y]) [Fact (0 < H.natDegree)] : Set (𝕃 H) in ArkLib/Data/Polynomial/RationalFunctions.lean moved from L111 to L395
  • lemma resultant_is_divisible_by_leadingCoeff {F : Type} [Field F] (f : F[X]) (hf : f ≠ 0) : in ArkLib/Data/Polynomial/Prelims.lean moved from L50 to L51
  • theorem H_tilde_equiv_H_tilde' (H : F[X][Y]) (hdeg : 0 < H.natDegree) : in ArkLib/Data/Polynomial/RationalFunctions.lean moved from L91 to L351
  • lemma guruswami_sudan_for_proximity_gap_property {k m : ℕ} [NeZero n] [NeZero m] in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean moved from L113 to L2100
  • theorem irreducibleHTildeOfIrreducible {H : Polynomial (Polynomial F)} in ArkLib/Data/Polynomial/RationalFunctions.lean moved from L57 to L1329
  • lemma guruswami_sudan_for_proximity_gap_property {k m : ℕ} [NeZero n] [NeZero m] in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean moved from L188 to L177
  • lemma probOfBadPts [Nonempty ι] [DecidableEq ι] in ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean moved from L81 to L1465
  • lemma isField_of_irreducible {H : F[X][Y]} (hdeg : H.natDegree ≠ 0) : in ArkLib/Data/Polynomial/RationalFunctions.lean moved from L67 to L1427
  • theorem correlatedAgreement_affine_curves [DecidableEq ι] in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean moved from L116 to L4196
  • lemma ξ_regular (x₀ : F) (R : F[X][X][Y]) (H : F[X][Y]) in ArkLib/Data/Polynomial/RationalFunctions.lean moved from L209 to L1467
  • def weightedDegree.{u} {F : Type u} [Semiring F] (p : F[X][Y]) (u v : ℕ) : Option ℕ in ArkLib/Data/Polynomial/Bivariate.lean moved from L94 to L99
  • lemma guruswami_sudan_for_proximity_gap_existence {k m : ℕ} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean moved from L176 to L159
  • lemma Lemma_A_1 {H : F[X][Y]} [Fact (0 < H.natDegree)] in ArkLib/Data/Polynomial/RationalFunctions.lean moved from L163 to L1061
  • theorem β_regular in ArkLib/Data/Polynomial/RationalFunctions.lean moved from L229 to L1043
  • theorem totalDegree_mul [IsDomain F] {f g : F[X][Y]} (hf : f ≠ 0) (hg : g ≠ 0) : in ArkLib/Data/Polynomial/Bivariate.lean moved from L364 to L423
  • lemma weight_ξ_bound (x₀ : F) {D : ℕ} (hD : D ≥ Bivariate.totalDegree H) in ArkLib/Data/Polynomial/RationalFunctions.lean moved from L222 to L1673
  • lemma guruswami_sudan_for_proximity_gap_existence {k m : ℕ} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean moved from L103 to L1942

sorry Tracking

✅ **Removed:** 51 `sorry`(s)
  • lemma exists_factors_with_large_common_root_set in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma e_leq_dist_over_3 in ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean
  • theorem RS_correlatedAgreement_affineLines {deg : ℕ} {domain : ι ↪ F} {δ : ℝ≥0} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma irreducible_factorization_of_gs_solution in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma approximate_solution_is_exact_solution_coeffs in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem weighted_correlated_agreement_for_parameterized_curves' in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma rootMultiplicity_some_implies_root {F : Type} [CommSemiring F] [DecidableEq F] in ArkLib/Data/Polynomial/Bivariate.lean
  • theorem linsolve_some {A : Matrix (Fin n) (Fin m) F} {b : Fin n → F} {x : Fin m → F} in ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean
  • theorem weighted_correlated_agreement_over_affine_spaces in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem RS_correlatedAgreement_affineLines_uniqueDecodingRegime in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem large_agreement_set_on_curve_implies_correlated_agreement' {l : ℕ} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma exists_a_set_and_a_matching_polynomial in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma modified_guruswami_has_a_solution in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem correlatedAgreement_affine_spaces {k : ℕ} [NeZero k] {u : Fin (k + 1) → ι → F} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma exists_points_with_large_matching_subset in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem average_proximity_implies_proximity_of_linear_subspace [DecidableEq ι] [DecidableEq F] in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • opaque linsolve (A : Matrix (Fin n) (Fin m) F) (b : Fin n → F) : Option (Fin m → F) in ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean
  • lemma resultant_is_divisible_by_leadingCoeff {F : Type} [CommRing F] [Inhabited F] (f : F[X]) in ArkLib/Data/Polynomial/Prelims.lean
  • lemma H_tilde_equiv_H_tilde' (H : F[X][Y]) : (H_tilde' H).map univPolyHom = H_tilde H in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma separable_iff_discr_eq_zero {F : Type} [Field F] [Inhabited F] (f : F[X]) : in ArkLib/Data/Polynomial/Prelims.lean
  • theorem linsolve_none {A : Matrix (Fin n) (Fin m) F} {b : Fin n → F} in ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean
  • lemma guruswami_sudan_for_proximity_gap_property {k m : ℕ} {ωs : Fin n ↪ F} in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • theorem weighted_correlated_agreement_for_parameterized_curves in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma guruswami_sudan_for_proximity_gap_property {k m : ℕ} {ωs : Fin n ↪ F} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma probOfBadPts {deg : ℕ} {α : ι ↪ F} {e : ℕ} {U_star : WordStack (A in ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean
  • lemma matching_set_is_a_sub_of_coeffs_of_close_proximity in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma weightedDegree_eq_natWeightedDegree {u v : ℕ} : in ArkLib/Data/Polynomial/Bivariate.lean
  • lemma irreducibleHTildeOfIrreducible {H : Polynomial (Polynomial F)} : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • theorem correlatedAgreement_affine_curves [DecidableEq ι] {k : ℕ} {u : Fin k → ι → F} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • opaque decoder (k r D e : ℕ) (ωs : Fin n ↪ F) (f : Fin n → F) : List F[X] in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • theorem decoder_dist_impl_mem in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • lemma discr_of_irred_components_nonzero in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma irreducible_H in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma ξ_regular (x₀ : F) (R : F[X][X][Y]) (H : F[X][Y]) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma distInterleavedCodeToCodeLB in ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean
  • theorem decoder_mem_impl_dist in ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
  • theorem proximity_gap_RSCodes {k t : ℕ} [NeZero k] [NeZero t] {deg : ℕ} {domain : ι ↪ F} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma solution_gamma_is_linear_in_Z in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma guruswami_sudan_for_proximity_gap_existence {k m : ℕ} {ωs : Fin n ↪ F} {f : Fin n → F} : in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma Lemma_A_1 {H : F[X][Y]} [Field F] [Fact (0 < H.natDegree)] in ArkLib/Data/Polynomial/RationalFunctions.lean
  • lemma solution_gamma_matches_word_if_subset_large in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma β_regular (R : F[X][X][Y]) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • theorem large_agreement_set_on_curve_implies_correlated_agreement {l : ℕ} in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma gamma_eq_P in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem embeddingOf𝒪Into𝕃_ideal_le (H : F[X][Y]) (hdeg : 0 < H.natDegree) : in ArkLib/Data/Polynomial/RationalFunctions.lean
  • theorem totalDegree_mul [IsDomain F] {f g : F[X][Y]} (hf : f ≠ 0) (hg : g ≠ 0) : in ArkLib/Data/Polynomial/Bivariate.lean
  • lemma approximate_solution_is_exact_solution_coeffs' in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • theorem weighted_correlated_agreement_over_affine_spaces' in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean
  • lemma weight_ξ_bound (x₀ : F) {D : ℕ} (hD : D ≥ Bivariate.totalDegree H) in ArkLib/Data/Polynomial/RationalFunctions.lean
  • 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 principal_is_maximal_iff_irred {F : Type} [Field F] (f : F[X]) : in ArkLib/Data/Polynomial/Prelims.lean

🎨 **Style Guide Adherence**

The following violations of the style guide were found:

Naming Conventions

  • File Names (Acronyms): The following files violate the rule: "Acronyms: Treat as words (e.g., HtmlParser not HTMLParser)":
    • ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean (should be Ahiv22.lean)
    • ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean (should be Bciks20.lean)
    • ArkLib/Data/CodingTheory/ProximityGap/DG25.lean (should be Dg25.lean)
  • Functions and Terms (snake_case violation): The following definitions violate the rule: "Functions and Terms: lowerCamelCase":
    • ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean: proximity_gap_degree_bound (line 1464), proximity_gap_johnson (line 1471).
    • ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean: D_X (line 53), proximity_gap_degree_bound (line 58), proximity_gap_johnson (line 71).
    • ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean: ε_uniqueDecoding (line 1243), ε_affineLines_factorFree (line 1247), ε_affineLines (line 1250), ε_affineLines_uniqueDecoding (line 1254), ε_affineCurves (line 1258), ε_affineSpaces (line 1262), ε_affineCurves_counting (line 1267), ε_affineSpaces_counting (line 1274).
    • ArkLib/Data/Polynomial/RationalFunctions.lean: H_tilde (line 49), H_tilde' (line 67), π_z_lift (line 394), π_z (line 414), weight_Λ (line 532), weight_Λ_over_𝒪 (line 542), S_β (line 546).
  • Functions and Terms (Acronyms/Symbols): The following definitions violate the rule: "Acronyms: Treat as words" and "Functions and Terms: lowerCamelCase":
    • ArkLib/Data/Polynomial/RationalFunctions.lean: ζ (line 1058), ξ (line 1152), β (line 1184), α (line 1198), α' (line 1211).
  • Types and Structures (Symbols): The following violate the rule: "Types and Structures: UpperCamelCase":
    • ArkLib/Data/Polynomial/RationalFunctions.lean: 𝕃 (line 58), 𝒪 (line 354).

Documentation Standards

  • Missing Docstrings: The following definitions violate the rule: "Every definition and major theorem should have a docstring":
    • ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean: multiplicityPairs (line 40), multiplicityPairsRowEmbedding (line 52), multiplicityPairsRow (line 55), polyOfCoeffs (line 312), polyOfCoeffsLinear (line 317), constraintMap (line 333), bCoeffLinear (line 344), constraintMapMul (line 352), messagePolynomials (line 454).
    • ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean: vecSupport (line 31), closePtsOnAffineLine (line 207), numberOfClosePts (line 212).
    • ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean: proximity_gap_degree_bound (line 58), proximity_gap_johnson (line 71), uniformWeight (line 540), affineEval (line 657).
    • ArkLib/Data/Polynomial/Bivariate.lean: coeffs (line 38), degreesX (line 41), degreesY (line 44), degreeX (line 48), degreeY (line 53), natDegreeX (line 58), natDegreeY (line 64), natWeightedDegree (line 96), weightedDegree (line 99), rootMultiplicity₀ (line 134), rootMultiplicity (line 140), monomial (line 192).
    • ArkLib/Data/Polynomial/Prelims.lean: discriminant (line 45).
    • ArkLib/Data/Polynomial/RationalFunctions.lean: Polynomial.Bivariate.Y (line 34), coeffAsRatFunc (line 1024), liftToFunctionField (line 1035), fieldTo𝕃 (line 1039), polyToPowerSeries𝕃 (line 1043), ζ (line 1058), ξ (line 1152), β (line 1184).
    • ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean: resultantY (line 30), specializeX (line 36), coeffVec (line 458), joinCoeffVec (line 460), polyOfVec (line 463).

Syntax and Formatting

  • Tactic Mode by placement: The following lines violate the rule: "Place by at the end of the line preceding the tactic block":
    • ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean: line 47.
    • ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean: line 1464.
  • Empty Lines in Proofs: The following files violate the rule: "Avoid empty lines inside definitions or proofs":
    • ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean: lines 183, 210, 233, 241, 475.
    • ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean: lines 253, 260, 266, 276, 303, 319, 329, 335, 344, 352, 360, 366, 373, 383 (inside distInterleavedCodeToCodeLB).
    • ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean: lines 1735, 1740, 1856, 1860.
    • ArkLib/Data/Polynomial/Bivariate.lean: lines 158, 203.
  • Standard File Headers: The following file violates the rule: "Use standard file headers including copyright, license (Apache 2.0), and authors":
    • ArkLib/Data/CodingTheory/ProximityGap/ListRecovery.lean

Variable Conventions

  • Greek letters for Naturals: The following violate the rule: "Variable Conventions: ... natural numbers m, n, k":
    • ArkLib/Data/CodingTheory/ProximityGap/DG25.lean: use of ϑ for a natural number (line 1921, 2004, 2068).

📄 **Per-File Summaries**
  • ArkLib.lean: The changes add imports for the ListRecovery proximity gap and RationalFunctionsInfrastructure modules to the main library file.
  • ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean: Formalized the linsolve function and its associated correctness theorems by replacing existing sorry stubs with noncomputable definitions and proofs.
  • ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean: This file formalizes the Guruswami–Sudan list decoding algorithm for Reed–Solomon codes, providing proofs for the existence of bivariate interpolants, the correctness of the decoding process, and bounds on the output list size.
  • ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean: Completes the formal proofs for Lemmas 4.3, 4.4, and 4.5 of the AHIV22 paper concerning proximity gap properties for interleaved and Reed-Solomon codes.
  • ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean: This update formalizes the proximity gap and correlated agreement results for Reed-Solomon codes from BCIKS20 by replacing placeholders with rigorous proofs based on Guruswami-Sudan list recovery and global consistency logic.
  • ArkLib/Data/CodingTheory/ProximityGap/DG25.lean: Refactor Reed-Solomon proximity gap and multilinear correlated agreement theorems to require the correlated agreement property for affine lines as an explicit hypothesis.
  • ArkLib/Data/CodingTheory/ProximityGap/ListRecovery.lean: This file introduces foundational lemmas for polynomial interpolation and curve evaluation to support list-recovery arguments in proximity-gap proofs.
  • ArkLib/Data/Polynomial/Bivariate.lean: This update provides formal proofs for the properties of bivariate polynomials—specifically the multiplicativity of total degree and root multiplicity implications—and implements the Y-discriminant using resultants.
  • ArkLib/Data/Polynomial/Prelims.lean: Updated the univariate discriminant definition and provided formal proofs for polynomial separability and the maximality of principal ideals generated by irreducible polynomials.
  • ArkLib/Data/Polynomial/RationalFunctions.lean: This update formalizes the construction and properties of the function field $\mathbb{L}$, the ring of regular elements $\mathcal{O}$, and the Hensel-lift power series $\gamma$, replacing several stubs with rigorous proofs for foundational lemmas from [BCIKS20].
  • ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean: This file provides infrastructure for bivariate polynomial resultants, establishing results for degree bounds, evaluation properties, and the relationship between resultants and common roots via the Sylvester matrix.

Last updated: 2026-03-03 00:48 UTC.

@FawadHa1der FawadHa1der marked this pull request as draft January 30, 2026 17:35
@FawadHa1der FawadHa1der changed the title Coding theory proofs WIP Coding theory proofs Jan 30, 2026
@FawadHa1der FawadHa1der marked this pull request as ready for review February 3, 2026 21:20
@FawadHa1der
Copy link
Author

I know probably a way too big of a PR :( but BCIKS is kinda a dependent on many things RationalFunctions, Guruswami etc. So I went ahead tried to prove as much as I could. I am still going and trying to remove any extra assumptions added to the proofs. But hopefully some of these proofs are helpful :) They include Guruswami, BKICS20, DG25, BerleyKamp and RationalFunctions

Codex 5.2.

@alexanderlhicks @quangvdao @chung-thai-nguyen

@alexanderlhicks alexanderlhicks self-assigned this Feb 7, 2026
@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.

@FawadHa1der
Copy link
Author

Sure I understand, let me know which proofs are useful and I can make a cleaner PR as well if you want. This is definitely too big of a PR for someone who is little new to FV.

@alexanderlhicks
Copy link
Collaborator

I think this looks mostly ok although I'll need a bit more time to manually go through all of it since there are some declaration changes.
Other than resolving the mergle conflict, it would help to also clean up some of the files which are now getting too big, but I could always do that as part of the refactor PR so it may be ok for this PR. Another option would be to split this PR into several more targeted PRs that might be easier to merge with causing issues.

@alexanderlhicks
Copy link
Collaborator

/review

External:
https://eprint.iacr.org/2020/654.pdf
https://eprint.iacr.org/2022/1608.pdf
https://eprint.iacr.org/2025/2010.pdf

Internal:
ArkLib/Data/CodingTheory/
ArkLib/Data/Polynomial

Comments:
Please review for correctness with respect to ArkLib internals and the external reference papers.

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

🤖 AI Review (with external context)

🤖 AI Review

Overall Summary:
Here is the synthesized Executive Summary of the Pull Request based on the specialized agent reviews:

1. TL;DR

The mathematical translation of the BCIKS20, AHIV22, and Guruswami-Sudan algorithms into Lean 4 is extremely impressive, correctly enforcing combinatorial bounds and completely eliminating a vast number of sorrys. However, the PR currently introduces several critical API breakages, a trivialized Hensel lift ($\beta = 0$), type errors regarding resultant arities, and some unidiomatic Lean 4 patterns that must be resolved before merging.

2. Checklist Coverage

  • Guruswami-Sudan Interpolation & Multiplicities:Verified. Multiplicity pairs, weighted degrees, and safe non-commutative implementations of shiftAt are highly robust.
  • Combinatorial Proximity Gaps (AHIV22):Verified. The exact ℚ≥0 arithmetic bounds and line direction degeneracy handling are correctly modeled.
  • Function Field $\mathbb{L}$ & Regular Elements:Verified. Gauss's lemma logic and denominator elimination for H_tilde are correct.
  • Curve and Affine Space Consistency:Verified. Lagrange bounds strictly enforce $&lt; S.card$, affine space cardinality gracefully avoids $0^0$, and probability boundaries are preserved.
  • Resultant and Discriminant Formulas: ⚠️ Ambiguous. While Prelims.lean implements the exact discriminant formula specified, Bivariate.lean implements discr_y purely as a resultant, mathematically violating the requested rigorous formula.
  • Hensel Lifting Power Series: ⚠️ Ambiguous. Base cases and inductive bounds are well-typed, but the core recursive variable definition was fatally trivialized (see Critical Misformalizations below).

3. Critical Misformalizations

  • Trivialization of Hensel Lift via β = 0 (RationalFunctions.lean): The existential witness for β_regular is set to 0. While this easily satisfies the weight bounds (as the weight of $0$ is $\bot$), it causes $\beta$—and consequentially the entire multiplicative Hensel lift $\alpha$—to evaluate identically to zero past the constant term. The existential proposition must explicitly enforce the algebraic recurrence identity defining $\beta_t$.
  • Destructive API Modification (Prelims.lean): The signature for resultant_is_divisible_by_leadingCoeff was modified from [CommRing F] to [Field F] (along with an added f ≠ 0 hypothesis). This allows a trivial proof via inverses, but fundamentally breaks downstream usage in Bivariate.lean, where the coefficient ring $F[X]$ is a CommRing but not a field. Revert to [CommRing F] and prove via Sylvester matrix properties.
  • Misuse of Polynomial.resultant Arity (RationalFunctionsInfrastructure.lean): Polynomial.resultant strictly accepts 2 arguments (p q : R[X]). The PR attempts to apply it to 4 arguments (p q m n) in several places (e.g., resultant_map, resultantY_eval), which is a fundamental type error. You must replace these instances with the determinant of the Sylvester matrix directly: (Polynomial.sylvester p q m n).det.
  • Discriminant Formula Mismatch (Bivariate.lean): The discr_y function strictly computes the resultant rather than the required formula (-1) ^ (n * (n - 1) / 2) * f.leadingCoeff⁻¹ * resultant f f'.

4. Key Lean 4 / Mathlib Issues

  • Broken Universe Polymorphism (2 files): In Bivariate.lean and GuruswamiSudan.lean, defining variables via {F : Type} permanently restricts $F$ to Type 0, causing unification failures for higher universes. Always use {F : Type*} or {F : Type u}.
  • Unidiomatic Binder Placement & Tactic Usage (2 files):
    • In DG25.lean, the h_ca Pi binder is explicitly declared after the colon. It should be moved to the hypothesis list.
    • In Sorries.lean, injection does not close goals automatically in Lean 4. Furthermore, using classical by_cases in linsolve_some is unidiomatic; use the split_ifs tactic to naturally branch on the if expression within linsolve.
  • Overly Strong / Unused Typeclasses (1 file): ListRecovery.lean uniformly copy-pastes [Fintype ι] and [DecidableEq ι] into lemmas where the index type ι does not actually require finiteness or decidability. Remove unused constraints.
  • Dead Code & Leaked Hypotheses (1 file): RationalFunctions.lean contains a massive 200+ line commented-out draft block. Additionally, Lemma_A_1 leaks an unproven hypothesis (hcoeff_H) into its signature. Fix: Restore the local proof of hcoeff_H inside Lemma_A_1 and use the omega tactic to close the trivial index inequalities you were stuck on.
  • Useless simp Hypothesis (1 file): In Bivariate.lean, the @[simp] lemma weightedDegree_eq_natWeightedDegree redundantly requires f ≠ 0. Because this holds definitionally for all polynomials (including $0$), requiring it prevents the simplifier from firing unless it explicitly has f ≠ 0 in context.
  • Deleted API Lemmas (1 file): Prelims.lean completely removes separable_iff_discr_eq_zero. While your new separable_iff_coprime_derivative wrapper is nice, deleting the discriminant characterization of separability is dangerous and likely to break downstream code. Preserve both lemmas.

5. Overall Verdict

Verdict: Changes Requested

While the elimination of sorrys and mathematical structure are excellent, the type errors regarding resultant arity, the destructive API changes to the coefficient rings, and the trivialization of the Hensel lift series are release blockers. Please address these issues and ping the synthesis team for a re-review.


📄 **Review for `ArkLib.lean`**

Verdict: Approved

Checklist Verification:

  • ⚠️ Verify that the set multiplicityPairs m strictly encodes the constraint a + b < m. (Cannot be determined from the diff alone, as the relevant definitions are not present in ArkLib.lean changes).
  • ⚠️ Check the definition of shiftAt and shiftAtRingHom. (Cannot be determined from the diff).
  • ⚠️ In GSCondition, verify that the weighted degree bound uses $1$ for $X$ and $k-1$ for $Y$. (Cannot be determined from the diff).
  • ⚠️ Confirm that exists_nonzero_interpolant_mul correctly uses linear algebra over F. (Cannot be determined from the diff).
  • ⚠️ In e_leq_dist_over_3 and e_leq_dist_over_3_strong, check the bounds on $e$. (Cannot be determined from the diff).
  • ⚠️ Verify that the 'line direction' vector v is correctly handled. (Cannot be determined from the diff).
  • ⚠️ For probOfBadPts, verify that PMF.uniformOfFintype is applied over the exact support. (Cannot be determined from the diff).
  • ⚠️ Check H_tilde and H_tilde'. (Cannot be determined from the diff).
  • ⚠️ In isField_of_irreducible, verify that the transition from $H$ being irreducible uses Gauss's Lemma. (Cannot be determined from the diff).
  • ⚠️ Verify π_z_lift and π_z. (Cannot be determined from the diff).
  • ⚠️ In discriminant, verify the formula. (Cannot be determined from the diff).
  • ⚠️ Check that resultantY computes the resultant with respect to the variable $Y$. (Cannot be determined from the diff).
  • ⚠️ In exists_bezout_of_resultant_eq_zero, ensure the relation $f * q + g * p = 0$ is extracted correctly. (Cannot be determined from the diff).
  • ⚠️ Verify the recursive definition of γTrunc and its infinite counterpart γ. (Cannot be determined from the diff).
  • ⚠️ Check the base case and inductive step for αClosedForm and α. (Cannot be determined from the diff).
  • ⚠️ Confirm that ξ is correctly typed as a regular element. (Cannot be determined from the diff).
  • ⚠️ In exists_polynomial_curve_through_values, check the Lagrange interpolation. (Cannot be determined from the diff).
  • ⚠️ For AffineSpaceGlobalConsistency, verify the cardinality threshold. (Cannot be determined from the diff).
  • ⚠️ In card_filter_gt_floor_of_prob_gt, check the conversion from ENNReal probabilities to Nat.floor. (Cannot be determined from the diff).

(Note: The provided diff exclusively contains two import additions (ArkLib.Data.CodingTheory.ProximityGap.ListRecovery and ArkLib.Data.Polynomial.RationalFunctionsInfrastructure) to the umbrella file ArkLib.lean. Because the prompt specifies to focus solely on the changes presented in the diff, the mathematical and Lean-specific checklist items cannot be verified here.)

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean`**

Verdict: Changes Requested

Checklist Verification:

  • ⚠️ Guruswami-Sudan Interpolation and Multiplicity Conditions [Critical]: N/A for this diff (no changes to GS).
  • ⚠️ Combinatorial Proximity Gaps on Affine Lines (AHIV22) [Major]: N/A for this diff.
  • ⚠️ Function Field $\mathbb{L}$ and Regular Elements $\mathcal{O}$ [Critical]: N/A for this diff.
  • ⚠️ Resultant and Discriminant Formulas [Major]: N/A for this diff.
  • ⚠️ Hensel Lifting Power Series ($\alpha, \beta, \gamma, \xi$) [Major]: N/A for this diff.
  • ⚠️ Curve and Affine Space Global Consistency (List Recovery) [Critical]: N/A for this diff.

Critical Misformalizations:
None. It is excellent to see the opaque solver and related sorry proofs removed and properly replaced with noncomputable, logically sound classical alternatives.

Lean 4 / Mathlib Issues:

  1. Unsolved Goal via injection: In linsolve_some, the proof block will cause a compilation failure:

        have hx : Classical.choose hsol = x := by
          injection hx' with hx
          -- Error: unsolved goals

    In Lean 4, the injection tactic introduces the generated equality into the local context but does not automatically close the goal, even if it perfectly matches. You must explicitly discharge it (e.g., by injection hx' with hx; exact hx).

  2. Unidiomatic Proof Strategy: Both linsolve_some and linsolve_none take a roundabout path to the contradiction by manually injecting a by_cases hsol : ∃ x ... and using simpa to force evaluation. A significantly cleaner and standard Mathlib approach relies on split_ifs to naturally branch on the if expression embedded within linsolve.

    Here is the fully golfed, idiomatic implementation:

    theorem linsolve_some {A : Matrix (Fin n) (Fin m) F} {b : Fin n → F} {x : Fin m → F}
      (h : linsolve A b = some x) : A.mulVec x = b := by
      rw [linsolve] at h
      split_ifs at h with hsol
      · cases h
        exact Classical.choose_spec hsol
      · contradiction
    
    theorem linsolve_none {A : Matrix (Fin n) (Fin m) F} {b : Fin n → F}
      (h : linsolve A b = none) : ¬∃ x, A.mulVec x = b := by
      rw [linsolve] at h
      split_ifs at h with hsol
      · contradiction
      · exact hsol

    (Note: The cases h tactic seamlessly unifies Classical.choose hsol and x across the goal without needing manual injection mapping).

Nitpicks:

  • Tactic Mode for Definitions: Defining linsolve using by classical exact if ... is slightly clunky. Term mode is highly preferred for definitions, even noncomputable ones. Since if requires Decidable, you can use open scoped Classical at the top of the file or an inline haveI := Classical.dec ... to satisfy it natively in term mode, though the tactic block is functionally acceptable as a workaround.
📄 **Review for `ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean`**

Verdict: Approved

Checklist Verification:

  • Guruswami-Sudan Interpolation and Multiplicity Conditions [Critical]
    • ✅ Verify that the set multiplicityPairs m strictly encodes the constraint a + b < m.
      (Implemented cleanly using Finset.filter on the cartesian product of ranges).
    • ✅ Check the definition of shiftAt and shiftAtRingHom.
      (Extremely well-done. Uses mapRingHom for the inner variable $X$ and compRingHom for the outer variable $Y$, entirely avoiding any commutativity/variable mix-up issues).
    • ✅ In GSCondition, verify that the weighted degree bound uses $1$ for $X$ and $k-1$ for $Y$.
      (Directly enforced via Polynomial.Bivariate.natWeightedDegree Q 1 (k - 1) ≤ D).
    • ✅ Confirm that exists_nonzero_interpolant_mul correctly uses linear algebra over F to guarantee a non-zero solution.
      (Correctly proven using LinearMap.ker_ne_bot_of_finrank_lt comparing the dimensions of the constraint maps against the monomialCount).
  • Combinatorial Proximity Gaps / Function Field / Resultant / Hensel
    • ⚠️ (Not applicable / skipped for this diff, as they appear to be in different files of the codebase).
  • Curve and Affine Space Global Consistency (List Recovery) [Critical]
    • (The theorem guruswami_sudan_for_proximity_gap_property successfully bridges the GS conditions to the divisibility condition, establishing the global list recovery bound proximity_gap_list_size_bound).

Critical Misformalizations:
None. The translation of the Guruswami-Sudan algorithm and its intricate dimensional and degree bounds (including the Johnson bound radius) into Lean is mathematically solid.

Lean 4 / Mathlib Issues:
None. It is fantastic to see such a massive block of sorrys completely eliminated. The use of Classical.choose for extracting the interpolant is fully idiomatic here given that GS interpolation guarantees existence but doesn't mandate a specific computable deterministic choice without imposing an arbitrary ordering.

Nitpicks:

  • Universe Polymorphism: The file uses variable {F : Type}. While this is likely inherited from the rest of the file/project, Mathlib best practice is to use variable {F : Type u} to remain universe polymorphic. Not a blocker for this PR, but something to keep in mind for library-wide refactors.
  • Hypothesis Naming / Usage: In decoder_dist_impl_mem, you prefixed _h_e with an underscore since it's no longer strictly needed by the localized proof (thanks to the introduction of h_div). This is perfectly fine for backwards-compatibility of the API signature.
📄 **Review for `ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean`**

Verdict: Approved

Checklist Verification:

  • Combinatorial Proximity Gaps on Affine Lines (AHIV22)
    • Bounds on $e$: Verified. The logic correctly translates the fractional bound (e : ℚ≥0) < ‖C‖₀ / 3 into the exact discrete bound 3 * e < ‖C‖₀ using strict ℚ≥0 arithmetic and exact_mod_cast. This completely avoids any integer division truncation issues.
    • Line direction vector $v$: Verified. The theorems and proofs correctly quantify over all $v$. In the degenerate case $v = 0$, the affine line collapses to a single point, and the logical disjunctions ∀ x ... ∨ numberOfClosePts ... still hold robustly without requiring a separate $v \neq 0$ assumption.
    • probOfBadPts: Verified. PMF.uniformOfFintype is perfectly typed over Matrix.rowSpan U_star (the exact support), and the probability calculation explicitly evaluates to (d : ENNReal) / Fintype.card F, matching the theoretical $d / |F|$ bound.

(Other checklist items are safely out of scope for the modified AHIV22.lean file.)

Critical Misformalizations:
None. The translation of Ligero's mathematical combinatorial arguments into Lean is exceptionally faithful. The proof of the error vectors forming a subspace and having a shared common support (exists_common_support_of_wt_le) correctly requires and applies the |F| > e condition, filling a subtle edge-case gap brilliantly.

Lean 4 / Mathlib Issues:
None. The formalization makes highly idiomatic use of Lean 4 / Mathlib's modules, quotient spaces (S ⧸ V), and outer measures (PMF.toOuterMeasure).

Nitpicks:

  • Redundant simpa block: In dirClose_of_manyClosePts and e_leq_dist_over_3_strong, there is a minor copy-paste artifact that appears several times:
    have hdiff' : r.1 * v i - r0.1 * v i = c r i - c r0 i := by
      simpa [Pi.add_apply, Pi.smul_apply] using (by
        simpa [Pi.add_apply, Pi.smul_apply] using this)
    This is just a harmless redundancy and can be simplified to a single simpa [Pi.add_apply, Pi.smul_apply] using this.
  • Repeated Arithmetic Block: The ~15-line block converting (e : ℚ≥0) < ‖C‖₀ / 3 into 3 * e < ‖C‖₀ is duplicated identically three times across the file. It might be worth extracting this into a tiny private lemma (e.g., private lemma three_mul_lt_of_lt_div_three) to DRY up the proofs, though it's totally acceptable as is.
📄 **Review for `ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean`**

Verdict: Approved

Checklist Verification:

  • Guruswami-Sudan Interpolation and Multiplicity Conditions [Critical]

    • ⚠️ Verify that the set multiplicityPairs m strictly encodes the constraint a + b < m. (Not present in this diff; likely in GuruswamiSudan.lean)
    • ✅ Check the definition of shiftAt and shiftAtRingHom. Ensure that the translation $X \mapsto X + x$ and $Y \mapsto Y + y$ respects the non-commutativity... (The semantic evaluation proofs shiftAt_eval_eq_comp_eval and shiftAt_coeff_zero_eq_eval in this diff correctly verify that the composition mimics the affine shifts $X \mapsto X+x$ and $Y \mapsto Y+y$ as intended mathematically).
    • ⚠️ In GSCondition, verify that the weighted degree bound uses $1$ for $X$ and $k-1$ for $Y$... (Not present in this diff)
    • ⚠️ Confirm that exists_nonzero_interpolant_mul correctly uses linear algebra... (Not present in this diff)
  • Combinatorial Proximity Gaps on Affine Lines (AHIV22) [Major]

    • ⚠️ In e_leq_dist_over_3 and e_leq_dist_over_3_strong, check the bounds on $e$. (Not present in this diff; likely in AHIV22.lean)
    • ⚠️ Verify that the 'line direction' vector v is correctly handled. (Not present in this diff)
    • ⚠️ For probOfBadPts, verify that PMF.uniformOfFintype is applied... (Not present in this diff)
  • Function Field $\mathbb{L}$ and Regular Elements $\mathcal{O}$ [Critical]

    • ⚠️ Check H_tilde and H_tilde'. (Not present in this diff)
    • ⚠️ In isField_of_irreducible, verify that the transition from $H$... (Not present in this diff)
    • ⚠️ Verify π_z_lift and π_z. (Not present in this diff)
  • Resultant and Discriminant Formulas [Major]

    • ⚠️ In discriminant, verify the formula... (Not present in this diff)
    • ⚠️ Check that resultantY computes the resultant... (Not present in this diff)
    • ⚠️ In exists_bezout_of_resultant_eq_zero, ensure the relation... (Not present in this diff)
  • Hensel Lifting Power Series ($\alpha, \beta, \gamma, \xi$) [Major]

    • ⚠️ Verify the recursive definition of γTrunc... (Not present in this diff)
    • ⚠️ Check the base case and inductive step for αClosedForm... (Not present in this diff)
    • ⚠️ Confirm that ξ is correctly typed... (Not present in this diff)
  • Curve and Affine Space Global Consistency (List Recovery) [Critical]

    • ⚠️ In exists_polynomial_curve_through_values, check the Lagrange interpolation. (Not present in this diff; likely in ListRecovery.lean)
    • ✅ For AffineSpaceGlobalConsistency, verify the cardinality threshold S.card > (|I| + 1) * |F|^{k-1}. Ensure that $|F|^{k-1}$ is evaluated using exact finite field cardinalities and avoids zero-to-the-power-of-zero edge cases if $k=1$. (Verified. d = (Fintype.card F) ^ (k - 1) safely uses Nat.pow over Nat.sub. When $k=1$, it safely yields $|F|^0 = 1$ and completely avoids zero-to-power-of-zero edges since $|F| \ge 2$).
    • ✅ In card_filter_gt_floor_of_prob_gt, check the conversion from ENNReal probabilities to Nat.floor. Ensure that the inequality strictness (>) is preserved through the floor operator and floating/real boundaries. (Verified. The theorem completely drops ENNReal bindings down to exact and leverages Nat.floor_le, properly maintaining the strict inequality < / > bound through integer casts without precision loss).

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None. (The PR impressively eliminates all sorry blocks originating from BCIKS20ProximityGapSection5 and elegantly delegates the structural logic to GSCondition. omit and variable hygiene is strictly respected).

Nitpicks:
None.

📄 **Review for `ArkLib/Data/CodingTheory/ProximityGap/DG25.lean`**

Verdict: Needs Minor Revisions

Checklist Verification:

  • ⚠️ Guruswami-Sudan Interpolation and Multiplicity Conditions: Not applicable. No code modified in this diff relates to GuruswamiSudan.
  • ⚠️ Combinatorial Proximity Gaps on Affine Lines (AHIV22): Not applicable. The diff modifies DG25.lean which depends on BCIKS20, but does not modify or use AHIV22 code related to e_leq_dist_over_3 or probOfBadPts.
  • ⚠️ Function Field $\mathbb{L}$ and Regular Elements $\mathcal{O}$: Not applicable.
  • ⚠️ Resultant and Discriminant Formulas: Not applicable.
  • ⚠️ Hensel Lifting Power Series: Not applicable.
  • ⚠️ Curve and Affine Space Global Consistency: Not applicable.

(Note: The changes in this PR specifically abstract out the sorry'd BCIKS20 Theorem 4.1 dependency into a hypothesis h_ca, completely sidestepping the checklist items for this specific file.)

Critical Misformalizations:
None. Abstracting the unproven RS_correlatedAgreement_affineLines_uniqueDecodingRegime into the hypothesis h_ca is a mathematically sound way to ensure DG25.lean remains rigorous and sorry-free while waiting for the BCIKS20 proof to be completed. The explicit substitution of ε with |ι| / |A| correctly mathematically corresponds to the unique decoding regime evaluation of errorBound.

Lean 4 / Mathlib Issues:

  • Unidiomatic Binder Placement: In reedSolomon_multilinearCorrelatedAgreement, the hypothesis h_ca is declared after the colon as an explicit Pi binder (h_ca : ...) → ∀ (ϑ : ℕ), .... This is highly unidiomatic in Lean 4 and inconsistent with the other two theorems in this file which correctly place h_ca before the colon.
    Move h_ca before the colon and remove intro h_ca from the proof:
    theorem reedSolomon_multilinearCorrelatedAgreement [Nontrivial (ReedSolomon.code α k)]
        (hk : k ≤ Fintype.card ι) {δ : ℝ≥0} (he : δ ≤ (Code.relativeUniqueDecodingRadius
          (C := (ReedSolomon.code α k : Set (ι → A)))))
        (h_ca :
          ∀ {δ' : ℝ≥0},
            δ' ≤ Code.relativeUniqueDecodingRadius (ι := ι) (F := A)
                  (C := (ReedSolomon.code α k : Set (ι → A))) →
              δ_ε_correlatedAgreementAffineLines (F := A) (A := A) (ι := ι)
                (C := (ReedSolomon.code α k : Set (ι → A))) (δ := δ')
                (ε := (Fintype.card ι : ℝ≥0) / (Fintype.card A : ℝ≥0))
        ) :
        ∀ (ϑ : ℕ), (hϑ_gt_0 : ϑ > 0) →

Nitpicks:

  • Variable Shadowing: In reedSolomon_multilinearCorrelatedAgreement, the implicit parameter {δ : ℝ≥0} in the theorem signature is shadowed by the bound variable ∀ {δ : ℝ≥0} inside the type of h_ca. While this is mathematically sound (as h_ca is universally quantified), it will trigger Lean 4's shadowing linter. Rename the bound variable in h_ca to δ' (as demonstrated in the snippet above) to avoid this.
📄 **Review for `ArkLib/Data/CodingTheory/ProximityGap/ListRecovery.lean`**

Verdict: Changes Requested

Checklist Verification:

  • Curve and Affine Space Global Consistency (List Recovery):
    • Lagrange interpolation degree strictness: In exists_polynomial_curve_through_values, the code successfully verifies and bounds (p x).natDegree < S.card (and similarly for degree), satisfying the checklist's strict bound requirement.
    • ⚠️ AffineSpaceGlobalConsistency and card_filter_gt_floor_of_prob_gt: These theorems are absent from this file's diff and cannot be reviewed here.
      (Note: The remaining checklist items correspond to different files in your repository and are not applicable to this diff).

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:

  • Overly Strong / Unused Typeclass Assumptions: The typeclasses [Fintype ι] and [DecidableEq ι] have been uniformly copy-pasted across the lemmas in this file. However, in almost all cases, they are completely unused because ι acts merely as an arbitrary index type for the coordinates, and no operations depend on its finiteness or decidability. This violates the Lean idiom of keeping typeclass constraints minimal.
    • In exists_polynomial_curve_through_values, exists_polynomial_curve_through_values_in_submodule, curve_coeff_eq_of_agree_on, and curveEval_injective, please remove both [Fintype ι] and [DecidableEq ι].
    • In card_curves_le_prod_lists, [Fintype ι] is required to automatically synthesize the Fintype instance for the function spaces (e.g., Fin (l + 2) → ι → F). However, [DecidableEq ι] remains completely unused and should be removed (since DecidableEq (ι → F) is resolved securely using only [Fintype ι] and [DecidableEq F]).

Nitpicks:

  • In curve_coeff_eq_of_agree_on, the manipulation of sums could be streamlined by applying Finset.sum_sub_distrib directly inside a calc block rather than relying on intermediate simpa bindings, though the current proof is logically sound and perfectly functional.
  • It is generally more idiomatic in Lean 4/Mathlib to use i.val or i.1 rather than (i : ℕ) when extracting the natural number from an i : Fin N, though the coercion explicitly functions as intended here.
📄 **Review for `ArkLib/Data/Polynomial/Bivariate.lean`**

Verdict: Changes Requested

Checklist Verification:

  • ⚠️ Resultant and Discriminant Formulas: The checklist asks to verify the formula (-1) ^ (n * (n - 1) / 2) * f.leadingCoeff⁻¹ * resultant f f' for the discriminant. The discr_y function introduced here does not implement this formula; it strictly computes Polynomial.resultant f (Polynomial.derivative f). While mathematically sufficient for checking the existence of multiple roots (since they only differ by non-zero factors in a domain), it technically violates the Specification Analyst's requested strict formula.
  • Resultant over Y: The checklist asks to verify that resultantY computes the resultant with respect to $Y$ by treating $X$ as the base ring. The code achieves exactly this: since F[X][Y] in Mathlib is defined as Polynomial (Polynomial F), applying Polynomial.resultant automatically treats it as a univariate polynomial in $Y$ with coefficients in $F[X]$.

Critical Misformalizations:
None. The logic and the tedious manual proofs over polynomial degrees (like totalDegree_mul) are mathematically sound and properly circumvent the need for sorry.

Lean 4 / Mathlib Issues:

  1. Broken Universe Polymorphism (Type vs Type*):
    At the top of the file, you correctly establish universe polymorphism using variable {F : Type*} [Semiring F]. However, in later declarations, you explicitly redeclare F as {F : Type}:

    lemma rootMultiplicity_some_implies_root {F : Type} [CommSemiring F] [DecidableEq F]
    def discr_y {F : Type} [CommRing F] (f : F[X][Y]) : F[X] :=

    In Lean 4, {F : Type} strictly restricts F to Type 0. This breaks universe polymorphism for these definitions and will cause unification failures for any downstream theorems operating in higher universes.
    Fix: Change these to {F : Type*} (or {F : Type u}).

  2. Useless Hypothesis in simp Lemma:
    The weightedDegree_eq_natWeightedDegree lemma includes a mathematically redundant hypothesis:

    @[grind _=_]
    lemma weightedDegree_eq_natWeightedDegree {u v : ℕ} :
      f ≠ 0 → weightedDegree f u v = natWeightedDegree f u v := by
      intro _
      simp [weightedDegree]

    Because weightedDegree is defined unconditionally as natWeightedDegree (with an implicit coercion to Option ℕ), the equality holds definitionally for all polynomials, including 0. As a @[simp] lemma, requiring f ≠ 0 means the simplifier will fail to fire unless it already holds a proof of f ≠ 0 in the context, rendering the lemma unidiomatic and brittle. The intro _ in your proof literally discards the hypothesis to prove the goal anyway!
    Fix: Remove the hypothesis entirely:

    @[grind _=_]
    lemma weightedDegree_eq_natWeightedDegree {u v : ℕ} :
      weightedDegree f u v = natWeightedDegree f u v := rfl

Nitpicks:

  1. weightedDegree returns some 0 for the zero polynomial:
    Because weightedDegree delegates directly to natWeightedDegree and expects an Option ℕ return type, Lean implicitly inserts a some coercion. Consequently, the zero polynomial evaluates to some 0 instead of none. While this matches the behavior of your previous List.max? implementation (which evaluated [0] to some 0), representing a zero polynomial's degree as some 0 is an anti-pattern in Mathlib (where degrees of 0 are typically via WithBot ℕ).
  2. discr_y is technically just the Resultant:
    The docstring says "Discriminant in Y...", but the function strictly returns the resultant of $f$ and $f'$. Mathematically, the discriminant differs from this resultant by the sign factor and the leading coefficient inverse. Since $R(f, f') = 0 \iff \Delta(f) = 0$ (assuming $a_n \neq 0$), this is perfectly functional for your use case, but the name and docstring might be slightly misleading.
📄 **Review for `ArkLib/Data/Polynomial/Prelims.lean`**

An analysis of the pull request reveals that while you successfully implemented the requested discriminant formula and removed sorrys from the file, a modification to the signature of a helper lemma severely breaks the downstream library compilation.

Verdict: Changes Requested

Checklist Verification:

  • Discriminant formula: The implementation (-1) ^ (f.natDegree * (f.natDegree - 1) / 2) * f.leadingCoeff⁻¹ * Polynomial.resultant f (Polynomial.derivative f) correctly respects the mathematical formula requested. Lean 4's integer division in Nat safely computes n * (n - 1) / 2 without precision loss or underflow (e.g., if n=0, 0 - 1 = 0 in Nat, yielding 0 / 2 = 0). Type inference correctly casts -1 directly into the field F.
  • ⚠️ resultantY definition: Not present in the provided diff for Prelims.lean.
  • ⚠️ exists_bezout_of_resultant_eq_zero bounds: Not present in the provided diff for Prelims.lean.

Critical Misformalizations:

  • Destructive modification of resultant_is_divisible_by_leadingCoeff: To prove this lemma, you changed the typeclass requirement from [CommRing F] to [Field F] and added the non-zero assumption (hf : f ≠ 0). While this allows for a trivial one-liner proof in a field using the inverse (f.leadingCoeff)⁻¹, it fundamentally breaks the API. In the global context (specifically inside ArkLib/Data/Polynomial/Bivariate.lean), the function discr_y invokes Classical.choose (resultant_is_divisible_by_leadingCoeff f) on a bivariate polynomial f : F[X][Y]. For f : F[X][Y], the underlying coefficient ring is F[X]—which is a CommRing, but not a Field. By restricting the lemma to [Field F] and demanding an explicit hf argument, discr_y will throw typeclass synthesis failures and arity mismatch errors. You must revert the signature to [CommRing F] (without hf) and prove it mathematically via the properties of the Sylvester matrix.

Lean 4 / Mathlib Issues:

  • Removal of separable_iff_discr_eq_zero: You deleted this lemma and replaced it with separable_iff_coprime_derivative. While separable_iff_coprime_derivative works as a trivial wrapper around Mathlib's Polynomial.separable_def, completely dropping the discriminant characterization of separability is dangerous. It will likely break downstream theorem dependencies that expect the discriminant f ≠ 0 condition. Consider preserving both lemmas.
  • Proof verbosity in principal_is_maximal_iff_irred: The manual proof of IsMaximal (span f) → Irreducible f explicitly manipulates units and divisibility over ~30 lines. Because F[X] is a Principal Ideal Domain, this direction could be drastically shortened using existing Mathlib PID mechanics (e.g., chaining Ideal.IsMaximal.isPrime and Ideal.span_singleton_prime). Note: Your manual proof is logically sound and valid Lean 4, so this is just a pointer for future maintainability.

Nitpicks:

  • Literal typing: While Lean 4 successfully infers (-1) as (-1 : F) in the discriminant definition due to the multiplication operator * f.leadingCoeff⁻¹, it is safer and more idiomatic to explicitly declare the base type as (-1 : F) ^ ... to bulletproof against future type inference breakages.
📄 **Review for `ArkLib/Data/Polynomial/RationalFunctions.lean`**

An excellent PR that tackles some of the heaviest algebraic machinery in the BCIKS20 paper. The formalization of the function field $\mathbb{L}$, the ring of regular elements $\mathcal{O}$, and the use of Gauss's Lemma to bridge irreducibility over $F[X]$ to $RatFunc(F)$ are very well executed.

However, there is a critical logical flaw in how the Hensel lift coefficients are extracted via Classical.choose, which trivializes the algorithm. Additionally, there is a large block of dead code and a leaked hypothesis that can be easily fixed with modern Lean 4 automation.

Verdict: Changes Requested

Checklist Verification:

  • Check H_tilde and H_tilde'. Verified. The implementation multiplies the $i$-th degree term (from the top) by $W^i$, correctly eliminating all denominators.
  • In isField_of_irreducible, verify Gauss's Lemma. Verified. It properly utilizes IsPrimitive.irreducible_iff_irreducible_map_fraction_map to transition irreducibility.
  • Verify π_z_lift and π_z. Verified. rationalRoot restricts evaluation to the roots of H_tilde', elegantly avoiding denominator issues since H_tilde' is polynomial.
  • Verify the recursive definition of γTrunc and γ. Verified. γTrunc constructs the series progressively in the local parameter and coeff_γ proves the mapping to $\alpha_n$.
  • Check the base case and inductive step for αClosedForm and α. Verified. The simplicity condition (represented via its degree bound implication hdeg) is meticulously threaded through αClosedForm, α, and ξ.
  • Confirm that ξ is correctly typed and bounded. Verified. ξ returns 𝒪 H and weight_ξ_bound proves the specified bound.

Critical Misformalizations:

  • Trivialization of the Hensel Lift via β = 0: The existential lemma β_regular defines the existence of $\beta$ solely by its weight bound: weight_Λ_over_𝒪 β D ≤ .... The provided proof witness is (0 : 𝒪 H) (since the weight of $0$ is $\bot$, which is $\le$ anything). Consequently, the definition of β—which uses Classical.choose on β_regular—evaluates identically to $0$ for all $t$. Because the definition of $\alpha$ depends multiplicatively on $\beta$, this causes the entire Hensel lifting series to be identically zero after the constant term!
    • Fix: To preserve the mathematical linkage, the existential proposition in β_regular must include the algebraic identity defining $\beta_t$ (derived from the recurrence of the Hensel lift), exactly as was done for ξ_regular (which explicitly enforces embeddingOf𝒪Into𝕃 _ pre = W ^ (d - 2) * ζ R x₀ H).

Lean 4 / Mathlib Issues:

  • Dead Code / Leftover Draft: A massive 200+ line commented-out block (+/- ... -/) containing a failed proof draft of Lemma_A_1 was left in the file. Dead code should be removed from the PR to maintain cleanliness.
  • Leaked Hypothesis in Lemma_A_1: In section Field, Lemma_A_1 includes a new hypothesis hcoeff_H. Looking at the commented-out code, it is clear you successfully wrote the proof for hcoeff_H but got stuck on a trivial inequality regarding indices:
    · -- k > H.natDegree: coefficient vanishes
      have hkgt : H.natDegree < k := lt_of_le_of_ne (Nat.le_of_lt_succ ?_) ?_
    Because you were in the False branches of k = H.natDegree and k < H.natDegree, Lean knows k > H.natDegree. You do not need to manually construct this with lt_of_le_of_ne. You can solve this instantly using the omega tactic:
    have hkgt : H.natDegree < k := by omega
    • Fix: Restore your local proof of hcoeff_H inside Lemma_A_1, use by omega to close the index inequality goals, and remove hcoeff_H from the theorem signature.

Nitpicks:

  • Redundant Recursion in α: The definition of α uses Nat.recOn t (αClosedForm ...) (fun n _ => αClosedForm ...) but ignores the recursive result _. While technically valid, it is unidiomatic because it functionally evaluates to just αClosedForm x₀ R H t hdeg regardless of the branch. If the intent is merely to map the closed form across indices, defining it directly without Nat.recOn is cleaner.
📄 **Review for `ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean`**

Verdict: Changes Requested

Checklist Verification:

  • Resultant computations with respect to Y: ✅ Code introduces resultantY mapping P Q : F[X][Y] to Polynomial.resultant P Q. This cleanly leverages Mathlib's Polynomial (Polynomial F) hierarchy, where the outer polynomial variable represents $Y$ and the inner coefficient ring F[X] captures $X$.
  • Bezout identity from Sylvester kernel:exists_bezout_of_resultant_eq_zero extracts $f * q + g * p = 0$ directly from the kernel of the Sylvester matrix (mulVec = 0). The strict degree bounds $p &lt; \deg(f)$ and $q &lt; \deg(g)$ are securely mathematically enforced using the natDegree_polyOfVec_lt lemma.
  • (Other checklist items were not present in this specific diff).

Critical Misformalizations:

  • Misuse of Polynomial.resultant Arity (Type Error): Mathlib's Polynomial.resultant takes exactly 2 arguments (p q : R[X]). The diff incorrectly applies it to 4 arguments (p q m n) in several places:

    • resultant_map
    • resultantY_eval
    • resultant_eq_zero_of_common_root'
    • resultant_eq_zero_of_common_root_eval'

    This is a type error and will fail to compile (unless a custom 4-argument overload is stealthily defined elsewhere, which is heavily anti-idiomatic). The Mathlib definition for the resultant bounded by $m, n$ is simply the determinant of the Sylvester matrix.

    Fix: Replace all instances of Polynomial.resultant p q m n with (Polynomial.sylvester p q m n).det.
    For example, resultant_map should be corrected to:

    lemma resultant_map (p q : R[X]) (m n : ℕ) :
        f ((Polynomial.sylvester p q m n).det) =
          (Polynomial.sylvester (p.map f) (q.map f) m n).det := by
      classical
      simp [Polynomial.sylvester_map, RingHom.map_det] -- sylvester_map will need adjustment

Lean 4 / Mathlib Issues:

  • Excellent Matrix Block Manipulation: The manual extraction of indices using Fin.addCases, Fin.castAdd, and Fin.natAdd perfectly maps to how Mathlib.RingTheory.Polynomial.Resultant.Basic constructs sylvester. This is highly idiomatic linear algebra in Lean 4.
  • Missing standard lemmas: Some lemmas like sum_perm_apply_eq_sum literally just wrap a single existing Mathlib lemma (Equiv.sum_comp). You could just use Equiv.sum_comp directly in your proofs to save overhead, but retaining the wrapper is mathematically harmless.

Nitpicks:

  • In sum_range_if_le, you mix n.succ in the induction step with k + 1 in the arithmetic. Consistently using n + 1 often makes omega or simp interactions slightly more robust.
  • The proof of sum_sigma_sub_eq_mul is a beautiful piece of combinatorial logic, but the sheer size of the calc blocks makes it slightly brittle to Mathlib updates. If you ever refactor, extracting the inner algebraic manipulation (∑ j, (σ j - j)) into a standalone helper lemma would clean up the scope.

@FawadHa1der
Copy link
Author

/review

External:
https://eprint.iacr.org/2020/654.pdf
https://eprint.iacr.org/2022/1608.pdf
https://eprint.iacr.org/2025/2010.pdf

Internal:
ArkLib/Data/CodingTheory/
ArkLib/Data/Polynomial

Comments:
Please review for correctness with respect to ArkLib internals and the external reference papers.

@FawadHa1der
Copy link
Author

I tried to fix the issue of vacuous error bounds and pushed the changes but cannot get the AI bot to trigger apparently. This definitely needs to be reviewed by coding theory experts

@alexanderlhicks
Copy link
Collaborator

I tried to fix the issue of vacuous error bounds and pushed the changes but cannot get the AI bot to trigger apparently. This definitely needs to be reviewed by coding theory experts

Permission issue, sorry 😞
Feel free to ping me anytime a review is required.

@alexanderlhicks
Copy link
Collaborator

/review

External:
https://eprint.iacr.org/2020/654.pdf
https://eprint.iacr.org/2022/1608.pdf
https://eprint.iacr.org/2025/2010.pdf

Internal:
ArkLib/Data/CodingTheory/
ArkLib/Data/Polynomial

Comments:
Please review for correctness with respect to ArkLib internals and the external reference papers.

@github-actions
Copy link

🤖 AI Review (with external context)

🤖 AI Review

Overall Summary:
The formalization of coding theory algorithms and proximity gap theorems is largely excellent and mathematically sound, faithfully adhering to the referenced BCIKS20 and AHIV22 papers. However, the pull request cannot be merged due to critical logical errors in ArkLib/Data/Polynomial/RationalFunctions.lean, where the Hensel lift coefficients are incorrectly trivialized to zero and invalid power series substitutions are used. These definitions must be rewritten to strictly follow the recursive construction described in the paper's appendix to ensure mathematical validity.


📄 **Review for `ArkLib.lean`**

Analysis of ArkLib.lean

The changes in ArkLib.lean consist of adding two import statements:

  1. import ArkLib.Data.CodingTheory.ProximityGap.ListRecovery
  2. import ArkLib.Data.Polynomial.RationalFunctionsInfrastructure

Logic and Correctness:

  • Structural Update: This file serves as a package aggregator. Adding imports here exposes new modules to users of the library.
  • Alignment with References:
    • RationalFunctionsInfrastructure: This module is strongly justified by the BCIKS20 paper provided in the global context. Section 2 (Proof Overview) and Appendix A explicitly discuss working over the rational function field $K = \mathbb{F}_q(Z)$ and algebraic extensions thereof to prove the proximity gap theorems. The formalization of these algebraic structures requires infrastructure for rational functions.
    • ListRecovery: While not explicitly titled "List Recovery" in the provided text snippets, the BCIKS20 paper relies heavily on the Guruswami-Sudan list decoding algorithm (Section 5) and discusses the "List Decoding Regime". List recovery is a generalization of list decoding often formalized alongside it.
  • Consistency: The naming conventions follow the existing hierarchy (ArkLib.Data.CodingTheory..., ArkLib.Data.Polynomial...).

Misformalization Check:

  • There is no logical code to misformalize here, only import declarations. Since the code compiles, the module paths exist.

Verdict:
The changes are Correct. They appropriately expose new modules necessary for the mathematical formalization of the techniques described in the reference papers (specifically the function field approach in BCIKS20).

📄 **Review for `ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean`**

Verdict: Correct

The formalization in ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean is correct.

Analysis:

  1. linsolve Definition: The replacement of opaque with noncomputable def utilizing Classical.choose is a standard and correct way to model a linear solver in a non-constructive mathematical context. It correctly returns some x containing a valid solution if the system $Ax=b$ is consistent, and none otherwise.
  2. linsolve_some Theorem: The proof correctly establishes that if the solver returns a value, that value satisfies the linear equation. The use of simpa with the decidability instances provided by classical is appropriate logic to unfold the definition and verify the witness property.
  3. linsolve_none Theorem: The proof correctly establishes the contrapositive: if the solver returns none, no solution exists. The proof by contradiction is logically sound.

The implementation aligns with the expected behavior of a generic linear solver interface used in coding theory proofs (like those referenced in the context of Berlekamp-Welch where solution existence guarantees decoding). No off-by-one errors, type mismatches, or universe issues were found. The code compiles and the logic is sound.

📄 **Review for `ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean`**

Analysis of ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean

The file implements the Guruswami-Sudan list decoding algorithm for Reed-Solomon codes. The formalization includes the definition of the interpolation conditions (vanishing with multiplicity), the linear-algebraic existence of the interpolant, the factorization step (root finding), and bounds on the list size.

1. Definitions and Structures:

  • multiplicityPairs: Correctly calculates the indices $(a,b)$ with $a+b &lt; m$ for multiplicity constraints. The cardinality proof $m(m+1)/2$ is correct.
  • Condition (and GSCondition): Correctly defines the requirements for the bivariate polynomial $Q(X,Y)$: non-zero, weighted degree bound, and vanishing with multiplicity $m$ at interpolation points $(\omega_i, f_i)$.
  • monomials: Correctly defines the support for $Q(X,Y)$ based on the weighted degree constraint $i + (k-1)j \le D$. Note that k here represents the dimension of the code (degree $&lt; k$), so the $Y$-weight is correctly $k-1$.

2. Interpolation (Existence):

  • exists_nonzero_interpolant_mul: Proves existence of $Q$ using a dimension counting argument (number of monomials vs. number of linear constraints). The constraints are linear maps derived via constraintMapMul. The logic follows standard linear algebra arguments over fields.

3. Root Finding (Factorization):

  • pow_X_sub_C_dvd_eval_of_vanish: Proves that if $Q$ vanishes at $(x,y)$ with multiplicity $m$, and $p(x)=y$, then $(X-x)^m \mid Q(X, p(X))$. This is the core algebraic lemma for the correctness of the reconstruction step.
  • divides_of_close_of_vanish: Proves that if a candidate message polynomial $p$ agrees with the received word $f$ on enough points, then $Y - p(X)$ divides $Q(X,Y)$. The condition derived is $D &lt; m(n-e)$, which matches standard results (where $n-e$ is the number of agreements).

4. Decoder Definition:

  • decoder: Defined as a non-computable function (using Classical.choose) that returns the list of all polynomials $p$ of degree $&lt;k$ such that $Y-p(X) \mid Q$ and $p$ is close to $f$. While brute-force in definition (iterating over all polynomials), it serves as a correct mathematical specification of the decoder's output.

5. Parameter Choices:

  • proximity_gap_degree_bound and johnson: These definitions implement specific parameter choices referenced from [BCIKS20].
  • Note: proximity_gap_degree_bound uses rho = (k+1)/n. Since k in ArkLib typically denotes dimension (polynomials of degree $&lt;k$), the rate is usually $k/n$. Using $(k+1)/n$ results in a slightly larger degree bound $D$, and consequently a slightly smaller decoding radius $e$ than the theoretical maximum for dimension $k$. This is a safe approximation (soundness is preserved), and likely aligns with the notation in the referenced paper where $k$ might denote degree.

6. List Size Bound:

  • decoder_length_le_johnson_bound: Proves that the output list size respects the Johnson bound combinatorial limit. This connects the algorithmic result to the combinatorial bound defined in ArkLib.Data.CodingTheory.JohnsonBound.

Summary:
The code is logically sound, mathematically correct, and consistent with the provided references.

Verdict: Correct.

📄 **Review for `ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean`**

Verdict: Correct

Feedback:
The formalization of the lemmas distInterleavedCodeToCodeLB, e_leq_dist_over_3, and probOfBadPts is correct and follows the established proof strategies for proximity gaps in Reed-Solomon codes (specifically the "method of lines" and support arguments).

  1. Logic and Correspondence: The proofs faithfully implement the logic described in the referenced papers ([AHIV17]/[AHIV22]).

    • distInterleavedCodeToCodeLB correctly identifies a common error support for the row span using the maximal support argument (encapsulated in exists_common_support_of_wt_le), relying on the field size condition $|F| &gt; e$.
    • e_leq_dist_over_3 (and its strong version) correctly analyzes affine lines, distinguishing between the case where the direction vector is close to the code (implying the whole line is close) and the case where it is far (implying few close points via unique decoding of the direction).
    • probOfBadPts correctly uses the decomposition of the space into affine lines to bound the probability.
  2. Implementation Details:

    • The use of private helpers is good practice.
    • The arithmetic bounds (e.g., $3e &lt; d$) are handled correctly using ℚ≥0 and exact_mod_cast.
    • The handling of Fintype.card vs Nat.card and Finset filtering is appropriate.
  3. Type Universe Change: The change of F and ι from Type* to Type is noted. This is often necessary for compatibility with probability/measure theory definitions in Lean (like PMF) which may not be fully universe polymorphic. Given these are finite types, this restriction is acceptable.

No issues found.

📄 **Review for `ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean`**

Verdict: Correct

The formalization in ArkLib/Data/CodingTheory/ProximityGap/BCIKS20.lean is correct. The changes successfully replace placeholders with rigorous proofs for the Unique Decoding regime and the combinatorial reductions required for the Proximity Gap theorems (Lemmas 7.5 and 7.6 from [BCIKS20]).

Detailed Assessment:

  1. Combinatorial Reductions (Lemmas 7.5 & 7.6):

    • The implementation of list_agreement_on_curve_implies_correlated_agreement_bound (Lemma 7.5) and sufficiently_large_list_agreement_on_curve_implies_correlated_agreement (Lemma 7.6) is logically sound.
    • The proofs correctly handle the double-counting arguments and the transition from probability bounds to cardinality bounds, including careful handling of integer/real coercions and strict inequalities.
    • The affine space generalizations of these lemmas are also correct, using the appropriate dimension bounds ($|F|^{k-1}$ derived in affine_solution_card_le).
  2. Unique Decoding Regime:

    • The theorem RS_correlatedAgreement_affineLines_uniqueDecodingRegime_closeToCode_heHalf correctly formalizes the argument that if a line is close to the code at many points, and $2e \le \text{UDR}$, then the line is close to a unique global codeword line.
    • The logic relies on the fact that two distinct lines agree on at most 1 point (or generally a low-degree variety), and the distance between the interpolated lines is bounded by the sum of errors ($2e$). Since $2e \le \text{UDR}$, the decoding is unique. The use of Code.eq_of_le_uniqueDecodingRadius is correct here.
  3. Threshold Definitions:

    • ε_uniqueDecoding is defined as $|D|/|F|$ ($n/q$), matching [BCIKS20] Theorem 1.2 for the unique decoding regime.
    • The file provides theorems like proximity_gap_RSCodes_affineLines_uniqueDecoding_branch that use this tight bound.
    • Other definitions like ε_affineLines use a looser counting bound ($n \cdot |RS| / q$), which is valid but weaker. The presence of both allows for flexibility, though users should prefer the _errorBound versions for the results claimed in the paper's introduction.
  4. Scope Limitations (Acceptable):

    • The theorems correlatedAgreement_affine_curves and correlatedAgreement_affine_spaces are parameterized by a ListRecoveryBound. The file currently provides instantiations using ..._of_listRecoveryBound_one, effectively restricting these results to the Unique Decoding regime (or list size 1).
    • The "proxy polynomial" argument (Section 5 of [BCIKS20]) required for the strong List Decoding bound appears to have been removed (deleted ModifiedGuruswami, exists_a_set_and_a_matching_polynomial etc.). This means the full List Decoding result (Theorem 1.4/5.1 for $\delta$ up to Johnson bound with error $\epsilon \approx n^2/q$) is not fully realized in this diff, but the Unique Decoding part (Theorem 4.1) is. This is a valid partial formalization.
  5. Code Quality:

    • The code uses omit to manage contexts cleanly.
    • The proofs, while long, follow logical steps and do not exhibit off-by-one errors or misuse of type universes.

The implementation is verified to be correct with respect to the supported subset of the external references.

📄 **Review for `ArkLib/Data/CodingTheory/ProximityGap/DG25.lean`**

Analysis of ArkLib/Data/CodingTheory/ProximityGap/DG25.lean

The changes in this file involve a refactoring of the proofs for proximity gaps in the unique decoding regime for Reed-Solomon codes. Specifically, the direct derivation of the correlated agreement property (based on library lemmas like RS_correlatedAgreement_affineLines_uniqueDecodingRegime) has been replaced by a hypothesis h_ca that assumes this property holds. This hypothesis is then propagated through the Nat (count-based) and multilinear generalizations.

This refactoring essentially decouples the usage of the correlated agreement result from its proof, likely to improve modularity or avoid circular dependencies. The mathematical content of the assumption h_ca matches the theorem statement it replaces (specifically, $\varepsilon = n/q$ for the unique decoding radius).

Review Checklist & Findings:

  1. Correctness of h_ca: The hypothesis h_ca correctly asserts the correlated agreement property for affine lines with error bound $\varepsilon = n/q$ ((Fintype.card ι) / (Fintype.card A)). This matches the theoretical result [BCIKS23, Thm 4.1] and the logic of the code it replaced.
  2. Propagation: The hypothesis is correctly added to ReedSolomon_ProximityGapAffineLines_UniqueDecoding and propagated up to reedSolomon_multilinearCorrelatedAgreement_Nat and reedSolomon_multilinearCorrelatedAgreement. The instantiation (h_ca := h_ca) is syntactically correct.
  3. Type Safety: The explicit types for $\varepsilon$ (using ℝ≥0 casting and division) are correct.
  4. Logic: The logical flow remains valid. The theorems now formally depend on h_ca, but assuming h_ca is satisfied (which is a standard result for RS codes), the theorems hold.

Conclusion:
The changes are correct and represent a valid refactoring of the formalization.

Verdict:
Formalization is correct.

📄 **Review for `ArkLib/Data/CodingTheory/ProximityGap/ListRecovery.lean`**

Analysis of ArkLib/Data/CodingTheory/ProximityGap/ListRecovery.lean

The file ArkLib/Data/CodingTheory/ProximityGap/ListRecovery.lean implements foundational lemmas for polynomial interpolation of curves, which serve as scaffolding for list-recovery arguments in proximity-gap proofs.

Key Definitions and Lemmas:

  1. exists_polynomial_curve_through_values:

    • Goal: Given values $r_z \in \iota \to F$ for $z$ in a finite set $S \subseteq F$, prove existence of a polynomial curve (coefficients $v_i : \iota \to F$) of degree less than $|S|$ that passes through these values.
    • Correctness: It utilizes Lagrange.interpolate from Mathlib. The manual construction of the coefficient functions v from the polynomial coefficients and the verification of the evaluation identity using Polynomial.eval_eq_sum_range are correct. The handling of the zero polynomial case for degree bounds using S.Nonempty is correct.
  2. exists_polynomial_curve_through_values_in_submodule:

    • Goal: Ensure that if the target values lie in a submodule $C$, the coefficients of the interpolating curve also lie in $C$.
    • Correctness: It exploits the linearity of the Lagrange basis. Since $v_i = \sum_{z \in S} c_{z,i} r_z$, and $C$ is a submodule, the closure properties sum_mem and smul_mem guarantee $v_i \in C$. The proof is rigorous.
  3. curve_coeff_eq_of_agree_on:

    • Goal: Prove that a curve of degree at most $l+1$ (represented by $l+2$ coefficients) is uniquely determined by its values on a set $S$ where $|S| &gt; l+1$.
    • Correctness: It constructs the difference polynomial $q$, shows it vanishes on $S$, and deduces $q=0$ because its degree is bounded by $l+1 &lt; |S|$. This correctly implies the coefficients of the difference are zero.
  4. card_curves_le_prod_lists:

    • Goal: Upper bound the number of curves passing through specific sets of values $L_z$ by the cardinality of the product of those sets.
    • Correctness: It uses the injectivity of the evaluation map (established by curveEval_injective via curve_coeff_eq_of_agree_on) to embed the set of valid curves into the dependent product of value lists. This is a standard combinatorial bound step in list recovery contexts.

Technical Assessment:

  • Indices and Boundaries: The use of Fin (l+2) corresponds to polynomials of degree at most $l+1$. The condition hS : S.card > l + 1 correctly ensures there are enough points ($|S| \ge l+2$) to uniquely determine the polynomial.
  • Type Correctness: The types align correctly with Mathlib's polynomial and fintype libraries.
  • Assumptions: S.Nonempty is used correctly to simplify degree reasoning.
  • Performance: set_option maxHeartbeats 1200000 is used for curve_coeff_eq_of_agree_on. While high, the proof involves significant expansion and manipulation of sums and polynomial evaluations, making the resource usage understandable for this style of proof.

Conclusion:
The formalization is correct and consistent with the intended algebraic and coding-theoretic concepts described in the provided context (Proximity Gaps, interpolation of parameterized curves).

Verdict: Correct.

📄 **Review for `ArkLib/Data/Polynomial/Bivariate.lean`**

Verdict: Correct

Feedback:
The formalization in ArkLib/Data/Polynomial/Bivariate.lean appears correct and logically sound.

  • Implementation Changes:

    • The transition to universe polymorphism (Type*) is consistent with modern Lean practices.
    • The redefinition of rootMultiplicity₀ correctly calculates the order of the polynomial at the origin (minimum degree of non-zero terms) instead of the previous incorrect behavior (using max).
    • The implementation of rootMultiplicity_some_implies_root correctly utilizes the updated multiplicity definition to prove that a positive multiplicity implies a root.
    • discr_y now computes the resultant of f and ∂f/∂Y directly, which corresponds to the standard definition of the discriminant (up to sign/coefficient factors) and matches the updated docstring.
    • The proof for totalDegree_mul is rigorous and correctly handles the degree arithmetic in an integral domain.
  • Definitions:

    • natWeightedDegree correctly computes the weighted degree by taking the supremum over the support of the polynomial in Y, and using the degree of the coefficient polynomials in X.
    • weightedDegree is retained as a wrapper around natWeightedDegree returning Option ℕ (which will essentially always be some), maintaining type compatibility while using the robust sup implementation.
  • Assumptions:

    • The proof totalDegree_mul correctly requires [IsDomain F] to ensure degrees add.
  • Dependencies:

    • The file imports Mathlib.Algebra.Polynomial.Bivariate, which does not exist in standard Mathlib. Assuming the "code confirmed to compile" instruction implies this dependency is satisfied within the project environment (e.g., a local file or fork), the logic within this file is correct. If this is meant to be standard Mathlib, the import is invalid.

No misformalization issues found.

📄 **Review for `ArkLib/Data/Polynomial/Prelims.lean`**

The changes in ArkLib/Data/Polynomial/Prelims.lean are correct.

  1. discriminant: The updated definition correctly includes the sign factor $(-1)^{n(n-1)/2}$ and the inverse of the leading coefficient, matching the standard formula for the discriminant of a polynomial over a field: $D(f) = (-1)^{\frac{n(n-1)}{2}} a_n^{-1} \text{Res}(f, f')$.
  2. resultant_is_divisible_by_leadingCoeff: The lemma is correctly proved for fields. While trivial in a field (where any non-zero element divides any other), the explicit construction and the addition of the f ≠ 0 hypothesis (required for leadingCoeff inversion) are logically sound.
  3. separable_iff_coprime_derivative: This lemma correctly identifies separability with the coprimality of the polynomial and its derivative, which is the standard definition in Lean's Mathlib for polynomials over fields.
  4. principal_is_maximal_iff_irred: The proof provided for the equivalence between a principal ideal being maximal and its generator being irreducible is correct. It handles the zero case, the unit case, and the factorization logic appropriately, utilizing the fact that $F[X]$ is a Principal Ideal Ring over a field $F$.

No misformalizations were found.

ArkLib/Data/Polynomial/Prelims.lean

-- No corrections needed.
📄 **Review for `ArkLib/Data/Polynomial/RationalFunctions.lean`**

Verdict: Incorrect

Critical Issues:

  1. Incorrect Definition of β, α, and γ (Trivialization):
    The definition of β relies on β_regular, which asserts the existence of a regular element satisfying a weight bound. The proof of β_regular trivially instantiates this with 0 (since 0 satisfies any non-negative weight bound). Consequently, def β ... := (β_regular ...).choose results in β being 0.
    This propagates to α (defined as β / ...), making α = 0, and γ (defined from α), making γ = 0.
    In the reference paper (Appendix A.4), α_t and β_t are specific values derived from the Hensel lifting recurrence relation (Equation A.1). They are not arbitrary elements satisfying a bound; the bound is a property of the specific Hensel lift coefficients. The formalization must define α and γ constructively to match the unique Hensel lift of the root $\alpha_0$, or define β recursively as in Equation (A.1), and then prove the weight bound as a theorem. Currently, the code defines the Hensel lift to be the zero power series, which is incorrect (unless the root being lifted is 0 and the equation allows it, but generally $R(X, 0, Z) \neq 0$).

  2. Incorrect Power Series Definition (γ):
    The definition of γ uses PowerSeries.subst:

    PowerSeries.subst (PowerSeries.mk subst) (PowerSeries.mk (fun t => α ...))

    The first argument PowerSeries.mk subst represents the polynomial $-x_0 + X$ (assuming fieldTo𝕃 maps to constant term). PowerSeries.subst f g is only well-defined for formal power series if the constant coefficient of f is nilpotent (usually 0 in domains). Here, the constant coefficient is $-x_0$. Unless $x_0 = 0$, this substitution is invalid in the ring of formal power series $L[[X]]$.
    The paper describes $\gamma$ as a power series in $(X - x_0)$. In Lean, this should be represented simply by the coefficients α (i.e., PowerSeries.mk α), with the understanding that the variable is $T = X - x_0$, or by working in a polynomial algebra where substitution is valid if termination is proven. Forcing it into $L[[X]]$ via subst without convergence guarantees is semantically wrong.

Suggestions for Correction:

  1. Define α / β Recursively: Implement the recurrence relation for the Hensel lift coefficients (as derived in the proof of Claim A.2 in the paper) directly.

    -- Conceptual sketch
    noncomputable def α_seq : ℕ → 𝕃 H
    | 0 => ... -- initial root T/W
    | (n + 1) => ... -- recurrence using previous αs, ζ, R derivatives

    Then prove the weight bounds for these specific definitions.

  2. Fix γ Definition: Define γ simply as the power series of coefficients, representing $\sum \alpha_t T^t$ where $T = X - x_0$.

    noncomputable def γ ... : PowerSeries (𝕃 H) :=
      PowerSeries.mk (fun t => α x₀ R H t hdeg)

    If you need to evaluate $R(X, \gamma)$ later, perform the substitution $X \mapsto x_0 + T$ into $R$ (which is a polynomial, so substitution is finite and valid), rather than substituting $T \mapsto X - x_0$ into the series.

Minor Issue:

  • Polynomial.Bivariate.Y is defined as Polynomial.X. While consistent within the file if F[X][Y] means Polynomial (Polynomial F), standard naming might suggest Y is the outer variable. The comment in the file clarifies the types, but ensure this aligns with ArkLib conventions.

Correctness of Logic in Lemma_A_1:
The logic for Lemma_A_1 (resultant arguments, cardinality bounds, irreducibility) appears correct and faithfully follows the paper's Appendix A.3. The fixes to H_tilde' indices also appear correct. The critical failures are confined to the Hensel lifting definitions (ClaimA2 section).

📄 **Review for `ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean`**

The formalization in ArkLib/Data/Polynomial/RationalFunctionsInfrastructure.lean is correct.

The file defines the resultant of bivariate polynomials with respect to one variable (resultantY) and the specialization of the other variable (specializeX). It proves key properties required for the analysis of rational functions in the context of the referenced papers (BCIKS20), specifically:

  1. Commutativity of resultant and evaluation: resultantY_eval proves that evaluating the resultant (in $X$) at a point $z$ is equivalent to computing the resultant of the specialized polynomials (in $Y$). This relies on the property that the determinant commutes with ring homomorphisms.
  2. Degree bounds: natDegree_resultantY_le_weight establishes a weighted degree bound for the resultant, which is essential for complexity analysis in the proximity gaps context. The proof rigorously handles the indices of the Sylvester matrix.
  3. Kernel of the Sylvester matrix: Lemmas like exists_bezout_of_resultant_eq_zero and resultant_eq_zero_of_common_root correctly relate the vanishing of the resultant to the existence of a common root (or common factor) and linear dependence of the column vectors corresponding to polynomial multiplication.

The definitions align with standard algebraic geometry concepts and the specific usage in the referenced literature (treating bivariate polynomials as univariate polynomials over a polynomial ring). The proofs for index manipulation and summations involving the Sylvester matrix are detailed and correct.

No issues found.

… coefficient-by-coefficient recursive construction
@FawadHa1der
Copy link
Author

@alexanderlhicks AI review required. I will leave the conflict resolution to you.

@alexanderlhicks
Copy link
Collaborator

/review

External:
https://eprint.iacr.org/2020/654.pdf
https://eprint.iacr.org/2022/1608.pdf
https://eprint.iacr.org/2025/2010.pdf

Internal:
ArkLib/Data/CodingTheory/
ArkLib/Data/Polynomial

Comments:
Please review for correctness with respect to ArkLib internals and the external reference papers.

@alexanderlhicks
Copy link
Collaborator

running the somewhat improved review workflow whilst on the road to see if it picks up anything, should be able to do a final manual pass and look at resolving the merge conflicts once done with travel hopefully. It would be nice to avoid big PRs like this in the future, especially when many new declarations are added and a lot of code could be cleaned up. I'm not necessarily enthusiastic about merging this given it will require a bunch of tweaking things later on to organise the files better and hide some of the noise of intermediary lemmas generated by Aristotle (this also duplicates some proofs that are in other PRs and forks).

eliasjudin added a commit to eliasjudin/ArkLib that referenced this pull request Mar 3, 2026
Add `numberOfClosePts_eq_natCard` as a reusable helper in AHIV22 for converting
`numberOfClosePts` to `Nat.card` in proximity-count arguments.

Refs Verified-zkEVM#227
Refs Verified-zkEVM#298

Co-authored-by: Aristotle (Harmonic) <aristotle-harmonic@harmonic.fun>
@katyhr
Copy link
Collaborator

katyhr commented Mar 3, 2026

@FawadHa1der I'm just seeing you tagged me in this, sorry! Thanks for this and for listening to my talk. Would it be helpful to review the PR? cc @alexanderlhicks

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.

3 participants