Folding preserves block relative distance balls (Claim 4.22 WHIR)#616
Folding preserves block relative distance balls (Claim 4.22 WHIR)#616ElijahVlasov wants to merge 29 commits into
Conversation
…decodable-folding
🤖 PR Summary
This pull request introduces formal definitions and theorems for block-relative distance on smooth Reed–Solomon codes and establishes the key property that folding preserves block-relative distance balls (Claim 4.22 of [ACFY24]). The main contributions are a new API for coset-FFT-domain blocks, the actual block-relative-distance theory in Statistics
Lean Declarations ✏️ Removed: 5 declaration(s)
✏️ Added: 61 declaration(s)
✏️ Affected: 6 declaration(s) (line number changed)
❌ Added: 1 `sorry`(s)
📋 **Additional Analysis**The diff introduces new files and modifies existing ones, but contains several violations of the ArkLib style guide, particularly in naming conventions, documentation standards, and line length. Additionally, some proofs are incomplete. Below are the specific findings organized by category. 📄 **Per-File Summaries**
Last updated: 2026-07-09 10:00 UTC. |
87ad7f5 to
b0e3330
Compare
alexanderlhicks
left a comment
There was a problem hiding this comment.
AI-generated review. This review was produced by Codex and has not been written by a human reviewer. Findings were validated at exact head
b0e333074acbf895a40d242741378057ff1e7715using an isolated build, exact-head GitHub CI, Lean axiom audits, direct evaluation of the fold formula, and comparison with the paper.
Conclusion: changes are required; this draft cannot merge in its current form. The deterministic block-distance contraction is useful, and the four advertised Claim-4.22 declarations are axiom-clean when imported narrowly. However, the umbrella build fails, the PR adds a new false sorry-backed theorem, and the final ball statement does not have WHIR Claim 4.22's code parameters.
Validation performed
lake build ArkLib/./scripts/validate.shreached 4,050 preceding targets and then failed because the environment already containsBlockRelDistance.disagreementSet. GitHub's exact-head build independently reports the same duplicate declaration.- Narrow
#print axiomschecks onfolding_contracts_block_distance,folding_contracts_block_rel_distance,folding_block_rel_ball, andfolding_preserves_block_ballsreported nosorryAx; a separate newly addedhammDist_foldWord_foldWordis closed bysorry. - The Hamming lemma was falsified directly from this PR's own
foldWord_k_1: forn = 2,α = 0, zerof, andgdiffering at one index in one fold pair over any valid odd-characteristic four-point domain (e.g.F_5), source Hamming distance is 1 and folded Hamming distance is 1, so the stated conclusion is2 ≤ 1. Mathlib defineshammingDistas the cardinality of disagreeing indices, so there is no normalization that could rescue the inequality. - Compared the ball statement with WHIR Claim 4.22, pp. 29–30: the paper maps
RS[F,L,m]toRS[F,L^(2),m-1]; it does not identifymwith domain log-sizen, mapnton/2, or assume2 ∣ n.
Required outcome
Rebuild this as a narrow Claim-4.22 change on #603: reuse its canonical block-distance module, remove the false Hamming lemma and spurious evenness condition, and quantify an independent code parameter m with source smoothCode ω m and target smoothCode (ω.subdomain 1) (m-1).
| ((f i + f i') / 2) + α * ((f i - f i') / (2 * x)) := by | ||
| aesop (add simp [foldWord_k_1]) | ||
|
|
||
| lemma hammDist_foldWord_foldWord [nz : NeZero n] (hn : 2 ∣ n) |
There was a problem hiding this comment.
AI-generated inline feedback — correctness/trust blocker. This statement is false as well as being closed by a new sorry. Validation: use n = 2, α = 0, f = 0, and let g differ from f at exactly one member of one binary fold pair over an odd-characteristic four-point domain (for example F_5). By foldWord_k_1 immediately above, that pair's folded value changes by 1/2, while every other output remains equal. Hence Δ₀(f,g)=1 and Δ₀(fold f,fold g)=1, making the conclusion 2 ≤ 1; 2 ∣ n is satisfied. WHIR Claim 4.22 needs block-distance contraction, not this raw Hamming claim. Please remove this lemma rather than trying to prove it.
| /-- Let C be a smooth ReedSolomon code `C = RS[F, ι^(2ⁱ), φ', m]` and `f,g : ι^(2ⁱ) → F`, then | ||
| the (i,k)-wise block relative distance is defined as | ||
| Δᵣ(i, k, f, S', φ', g) = |{z ∈ ι ^ 2^k : ∃ y ∈ Block(i,k,S',φ',z) f(y) ≠ g(y)}| / |ι^(2^k)|. -/ | ||
| def disagreementSet |
There was a problem hiding this comment.
AI-generated inline feedback — reproducible build blocker. This duplicates BlockRelDistance.disagreementSet already imported from ProofSystem/Whir/BlockRelDistance.lean. Both isolated lake build ArkLib and the exact GitHub build stop with the same environment-already-contains error. Please rebase on #603 and import its canonical Data-layer declaration instead of introducing a second definition.
|
|
||
| lemma folding_block_rel_ball [NeZero n] | ||
| {α : F} {δ : ℝ≥0} (hk : 1 ≤ k) (hkn : k ≤ n) (hn_dvd : 2 ∣ n) {u : Word F (Fin (2 ^ n))} | ||
| (hu : u ∈ Λ𞁒(code (ω : Fin (2 ^ n) ↪ F) n, k, ω, f, δ)) : |
There was a problem hiding this comment.
AI-generated inline feedback — paper fidelity (blocking). Here n is the log-size of the evaluation domain, but it is also used as the RS degree parameter, and line 68 changes the target to n / 2. I checked WHIR Claim 4.22, pp. 29–30: one fold maps RS[F,L,m] (ordinary degree bound 2^m) to RS[F,L^(2),m-1] (bound 2^(m-1)) for an independent m. Please quantify m separately and state this using smoothCode ω m / smoothCode (ω.subdomain 1) (m-1), relying on the corrected Claim-4.15 bridge.
| variable {f : Word F (Fin (2 ^ n))} | ||
|
|
||
| lemma folding_contracts_block_distance [NeZero n] | ||
| {α : F} (hk : 1 ≤ k) (hkn : k ≤ n) (hn_dvd : 2 ∣ n) |
There was a problem hiding this comment.
AI-generated inline feedback — unnecessary hypothesis. I checked the proof body: hn_dvd : 2 ∣ n is unused, and no such restriction appears in WHIR Claim 4.22. Please remove it from both metric-contraction lemmas. The public [NeZero n] can also be derived locally from 1 ≤ k and k ≤ n, avoiding another redundant caller obligation.
No description provided.