Block Relative distance refactor + proofs#603
Conversation
|
To be reviewed after #599 |
🤖 PR Summary
This PR refactors the block relative distance module, moves deprecated code to an Statistics
Lean Declarations ✏️ Removed: 5 declaration(s)
✏️ Added: 34 declaration(s)
📋 **Additional Analysis**The diff introduces a new file 📄 **Per-File Summaries**
The diff adds Last updated: 2026-07-17 16:21 UTC. |
e4d541d to
4859302
Compare
1e403c3 to
4619f8f
Compare
4619f8f to
b28cb19
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
b28cb192bb62f6a674489296dae282524ecca4efagainst the source paper, Lean's axiom output, repository builds, current consumers, and exact-head CI logs.
Conclusion: the mathematics is strong, but integration changes are needed before landing. The new Data-layer definitions faithfully capture WHIR Definitions 4.16–4.18 and Claim 4.19, pp. 27–28. Both Claim 4.19 conclusions are fully proved and axiom-clean. This is the strongest complete paper result in this four-PR series.
Validation performed
lake build ArkLibcompleted all 4,110 jobs at this exact SHA../scripts/validate.shexited only for the inherited missingNOZ26BibTeX key, not a Lean failure.#print axioms BlockRelDistance.relHammingDist_le_blockRelDistanceand#print axioms BlockRelDistance.listBlock_subset_listHammingreported nosorryAx.- Statement-by-statement comparison checked block fibers, normalization by
|L^(2^k)|, the block ball, Hamming lower bound, and list inclusion against WHIR 4.16–4.19. - GitHub's exact website job was inspected: this PR causes missing links for
BlockRelDistance.block,BlockRelDistance.minBlockRelDistance, andBlockRelDistance.listBlockRelDistance;SendClaim.completenessin the same job is inherited. - Current WHIR consumers were searched:
ProofSystem/Whir/Folding.leanandRBRSoundness.leanstill explicitly use the quarantinedObsoleteAPI. A synthetic current-main + #603 + #657 stack builds (4,128 jobs), so #657 is compatible with the proposed canonical layer.
Required outcome
- Preserve compatibility aliases (or provide a documented migration) for renamed domain declarations.
- Migrate/bridge the old WHIR consumers instead of leaving the proved API as a parallel island.
- Repair the three stale blueprint declaration links and run
./scripts/validate.sh --site. - Describe the smooth-code-free metric as an intentional generalization of the paper's constrained-RS presentation.
|
|
||
| @[simp] | ||
| lemma block_k_1 : | ||
| lemma block_k_0 : |
There was a problem hiding this comment.
AI-generated inline feedback — compatibility. The corrected k = 0 names are mathematically better, but diff/API inspection confirms that this PR removes block_k_1, card_block_le, blockIdx_k_1_of_eq, blockIdx_k_1_of_ne_mem, and block_x_0. Please keep deprecated aliases for the renamed declarations and retain the useful zero-block theorem for a migration window. This is particularly important because the related #616 head and existing WHIR work use the prior surface.
|
|
||
| namespace BlockRelDistance | ||
|
|
||
| namespace Obsolete |
There was a problem hiding this comment.
AI-generated inline feedback — canonical ownership. I validated usages with a repository-wide search: ProofSystem/Whir/Folding.lean explicitly opens this Obsolete namespace, and RBRSoundness.lean continues to depend on its indexPowT/ball semantics and gap-backed results. Please add a concrete bridge or migrate those consumers in this PR (or link a scoped, blocking follow-up with the exact declarations to replace). Otherwise the faithful, proved WHIR 4.16–4.19 API is not yet advancing the proof-system formalization that consumes it.
|
|
||
| ## Implementation notes | ||
|
|
||
| Block relative distance is defined for smooth rather than constrained Reed Solomon codes, |
There was a problem hiding this comment.
AI-generated inline feedback — source attribution. I checked WHIR Definitions 4.17–4.18, p. 27: the paper presents these notions for a constrained Reed–Solomon code, whereas this Lean definition validly generalizes away from the unused code parameter to any smooth domain/words. Please describe that as an intentional generalization, not as what the paper itself does. A short note explaining how the paper instance is recovered would make the fidelity boundary explicit.
Improvements to Block Relative distance stuff + proof of the lemma 4.19 from the WHIR paper.