feat: completeness and rbrKnowledgeSoundness of FRI-Binius protocols#383
feat: completeness and rbrKnowledgeSoundness of FRI-Binius protocols#383chung-thai-nguyen wants to merge 30 commits intomainfrom
Conversation
🤖 Gemini PR SummaryFormalizes completeness and round-by-round knowledge soundness (RBRKS) for the FRI-Binius protocol suite, including Binary Basefold and Ring-switching constructions. Mathematical Formalization
Infrastructure & Oracle Reductions
Protocol Implementations
Proof Status & PlaceholdersNote: A discrepancy exists between the PR body ("Fully proved") and the actual source code. The following
Refactoring
Statistics
Lean Declarations ✏️ **Removed:** 77 declaration(s)
✏️ **Added:** 869 declaration(s)
✏️ **Affected:** 48 declaration(s) (line number changed)
✅ **Removed:** 38 `sorry`(s)
🎨 **Style Guide Adherence**This review identifies extensive style guide violations across the provided changes. Due to the high volume of naming and formatting issues, violations are grouped by rule. Naming Conventions: Theorems & ProofsRule: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
Naming Conventions: Functions & TermsRule: "Functions and Terms: lowerCamelCase (e.g., binarySearch, isPrime)."
Naming Conventions: AcronymsRule: "Acronyms: Treat as words (e.g., HtmlParser not HTMLParser)."
Symbol Naming DictionaryRule: "0 -> zero, 1 -> one."
Syntax and Formatting: Line LengthRule: "Keep lines under 100 characters."
Syntax and Formatting: Empty LinesRule: "Avoid empty lines inside definitions or proofs."
Syntax and Formatting: Tactic ModeRule: "Place by at the end of the line preceding the tactic block. Indent the tactic block."
Syntax and Formatting: Binders & OperatorsRule: "Use a space after binders... Put spaces on both sides of : , := , and infix operators."
Syntax and Formatting: FunctionsRule: "Prefer fun x ↦ ... over λ x, ..." (And by extension, prefer
Documentation StandardsRule: "Every definition and major theorem should have a docstring."
Variable ConventionsRule: "m, n, k : Natural numbers; u, v, w : Universes."
📄 **Per-File Summaries**
Last updated: 2026-04-06 12:53 UTC. |
9edd9d8 to
6de2e83
Compare
749ed55 to
2b6222f
Compare
|
/review External: Internal: Comments: |
🤖 AI Review (with external context)🤖 AI ReviewOverall Summary: 1. TL;DRThe PR effectively establishes the architectural framework for the probabilistic monadic oracle reductions and mathematically solidifies key aspects of the Binius protocol, such as the block-matrix determinants and additive NTT domain mappings. However, the presence of widespread incomplete proofs ( 2. Checklist Coverage
3. Critical Misformalizations
4. Key Lean 4 / Mathlib Issues
5. Overall VerdictChanges Requested (Note: The hard rule requires any PR containing 📄 **Review for `ArkLib.lean`**Verdict: Approved Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues: Nitpicks: 📄 **Review for `ArkLib/Data/CodingTheory/Prelims.lean`**Verdict: Needs Minor Revisions Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Best Practices: Nitpicks:
📄 **Review for `ArkLib/Data/CodingTheory/ReedSolomon.lean`**Verdict: Approved Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues: Nitpicks:
📄 **Review for `ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/Data/Fin/BigOperators.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/Data/Misc/Basic.lean`**Verdict: Approved Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues: Nitpicks:
📄 **Review for `ArkLib/OracleReduction/Basic.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Here is the suggested idiomatic refactoring for def mkVerifierOStmtOut
(embed : ιₛₒ ↪ ιₛᵢ ⊕ pSpec.MessageIdx)
(hEq : ∀ i, OStmtOut i = match embed i with
| Sum.inl j => OStmtIn j
| Sum.inr j => pSpec.Message j)
(oStmt : ∀ i, OStmtIn i) (transcript : FullTranscript pSpec) :
∀ i, OStmtOut i :=
fun i => match h : embed i with
| Sum.inl j => cast (by rw [hEq, h]) (oStmt j)
| Sum.inr j => cast (by rw [hEq, h]) (transcript j)If you make this change, you should adjust the right-hand sides of your lemmas to use Nitpicks: 📄 **Review for `ArkLib/OracleReduction/Cast.lean`**Verdict: Changes Requested Checklist Verification:
Explanation: All items are marked Critical Misformalizations: Lean 4 / Mathlib Issues:
subst_vars
exact hPCThe Fix: You must manually substitute the index equalities to align the types, then convert the -- Unify the index types first
subst h_idxIn h_idxOut
-- Now that index types are unified, HEq becomes Eq
simp only [heq_iff_eq] at h_ostmtIn h_ostmtOut h_Oₛᵢ h_relIn h_relOut
-- Substitute everything else
subst h_stmtIn h_stmtOut h_witIn h_witOut h_ostmtIn h_ostmtOut h_Oₛᵢ h_relIn h_relOut
exact hPC
(h_rel : relOut₁ = cast (by subst_vars; rfl) relOut₂)This is unidiomatic and fragile. When Fix: Use (h_rel : HEq relOut₁ relOut₂)And in the proof: subst h_stmt h_ostmt h_wit
simp only [heq_iff_eq] at h_rel
subst h_rel
exact hPCNitpicks:
[∀ i, OracleInterface (OStmtOut₁ i)] [∀ i, OracleInterface (OStmtOut₂ i)]Looking at the 📄 **Review for `ArkLib/OracleReduction/Completeness.lean`**Verdict: Approved Checklist Verification:
(Note: The other checklist items correspond to other mathematical primitives like Additive NTT, Binius foldings, and Berlekamp-Welch. They are not present/modified in the diff of Critical Misformalizations: Lean 4 / Mathlib Issues: Nitpicks:
📄 **Review for `ArkLib/OracleReduction/Execution.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/OracleReduction/OracleInterface.lean`**Verdict: Approved Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues: Nitpicks: 📄 **Review for `ArkLib/OracleReduction/Security/RoundByRound.lean`**Verdict: Approved Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues: Nitpicks: 📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/General.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations:
Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean`**An analysis of the pull request reveals that while the structural approach to modeling the F-IOR and proving completeness via monadic simulations is highly aligned with the project's F-IOR blueprint, there are a number of incomplete proofs and performance hacks that need to be addressed before this can be merged. Verdict: Changes Requested Checklist Verification:
Critical Misformalizations:
Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations:
Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
toFun_empty := fun stmt witMid => by
-- sumcheck consistency is trivial since there is no variables left
sorryPlease complete this proof or use Nitpicks: 📄 **Review for `ArkLib/ProofSystem/Binius/FRIBinius/General.lean`**Verdict: Approved Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues: Nitpicks:
📄 **Review for `ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations:
Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/ProofSystem/Binius/RingSwitching/General.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/ProofSystem/Binius/RingSwitching/Prelude.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks: 📄 **Review for `ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/ProofSystem/Component/CheckClaim.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks: 📄 **Review for `ArkLib/ProofSystem/Component/ReduceClaim.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks: 📄 **Review for `ArkLib/ProofSystem/Component/SendWitness.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks: 📄 **Review for `ArkLib/ToVCVio/Lemmas.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks:
📄 **Review for `ArkLib/ToVCVio/Simulation.lean`**Verdict: Changes Requested Checklist Verification:
Critical Misformalizations: Lean 4 / Mathlib Issues:
Nitpicks:
|
55b1ac6 to
1d535d3
Compare
Build Timing Report
Incremental Rebuild Signal
This compares a clean project build against an incremental rebuild in the same CI job; it is a lightweight variability signal, not a full cross-run benchmark. Slowest Current Clean-Build FilesShowing 20 slowest current targets, with comparison against the selected baseline when available.
|
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
5334eb3 to
1f6838a
Compare
0594de9 to
4e8c9ed
Compare
ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/FinalSumcheck.lean
Outdated
Show resolved
Hide resolved
ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/FinalSumcheck.lean
Outdated
Show resolved
Hide resolved
- add the Binary Basefold paper-version note to the file header - remove duplicate references/commented-out code - drop the duplicate OptionT.simulateQ_failure' lemma - update downstream callers and verify with full lake build
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[x] Completeness/Soundness unfolding tools & snippets - mainly tools for converting the monadic defs into the logical defs (Completeness.lean, ReductionLogic.lean, Simulation.lean, Lemmas.lean) + new cast definition of oracle reduction (OracleReduction/Cast.lean) with completeness/rbrks compatibility
[x] Completeness & rbrKnowledgeSoundness for all FRI-Binius protocols: Binary Basefold, Ring-switching, FRI-Binius, simple ring-switching construction (BBFSmallFieldIOPCS), completeness of BBFSmallFieldIOPCS
[x] Minor changes: reintroduce AdditiveNTT.lean with index changes, will be migrated to CompPoly later
Status: Fully proved (no sorrys remaining)
Built with the help of Codex, Claude, Cursor, Gemini.