Skip to content

feat: completeness and rbrKnowledgeSoundness of FRI-Binius protocols - #383

Open
chung-thai-nguyen wants to merge 53 commits into
mainfrom
completeness-of-binius
Open

feat: completeness and rbrKnowledgeSoundness of FRI-Binius protocols#383
chung-thai-nguyen wants to merge 53 commits into
mainfrom
completeness-of-binius

Conversation

@chung-thai-nguyen

@chung-thai-nguyen chung-thai-nguyen commented Mar 3, 2026

Copy link
Copy Markdown
Collaborator

[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.

@github-actions

github-actions Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

🤖 Gemini PR Summary

Formalizes completeness and round-by-round knowledge soundness (RBRKS) for the FRI-Binius protocol suite, including Binary Basefold and Ring-switching constructions.

Mathematical Formalization

  • Additive NTT & Coding Theory: Implements the FRI-Binius variant of the Additive NTT algorithm. Adds properties for Reed-Solomon codes, multilinear weight decompositions, and the relationship between fiberwise agreement and folded codeword distance.
  • Security Invariants: Formalizes results from Diamond and Posen (2024), specifically Lemma 4.22 (interleaved-distance lower bounds) and Lemma 4.25 (disagreement transfer).
  • Core Propositions: Establishes Proposition 4.21 (bad folding event probability) and Proposition 4.24 (query phase soundness), yielding a concrete scalar knowledge soundness bound for Binary Basefold.
  • Probability & Folding: Adds Schwartz-Zippel bounds for univariate polynomials and product rules for independent repetitions. Formalizes butterflyMatrix and the connection between pointwise folding and polynomial evaluation.

Infrastructure & Oracle Reductions

  • Monadic-to-Logical Translation: Introduces tools in Completeness.lean and ReductionLogic.lean to convert monadic oracle definitions into logical predicates for property verification.
  • Modular Reductions: Adds OracleReduction/Cast.lean to enable oracle statement routing and type-safe transformations while preserving security properties.
  • Simulation Framework: Implements simulation oracles based on deterministic transcript lookups and refactors OracleVerifier.run to establish equivalences between oracle-based and non-oracle reductions.
  • Indexing Utilities: Introduces OracleFrontierIndex for mapping oracle positions to evaluation domain indices and provides general utilities for block matrix determinants and vector reindexing.

Protocol Implementations

  • Establishes completeness and RBRKS for Binary Basefold, Ring-switching, and FRI-Binius.
  • Formalizes the BBFSmallFieldIOPCS ring-switching construction and its completeness proof.
  • Sequentially composes Fold, Commit, and Sumcheck steps to prove aggregate security properties.

Proof Status & Placeholders

Note: A discrepancy exists between the PR body ("Fully proved") and the actual source code. The following sorry placeholders remain:

  • ArkLib/OracleReduction/Security/RoundByRound.lean: Incomplete proof for rbrKnowledgeSoundnessOneShot_implies_rbrKnowledgeSoundness.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean: The theorem iterated_fold_transitivity remains unproven.

Refactoring

  • Architecture: Decomposes the Binary Basefold implementation into a structured Steps/ directory, isolating logic for folding, commitment, and sum-check rounds.
  • Proof Maintenance: Refactors high-level proofs in DivergenceOfSets.lean and AffineSpaces.lean to use structured calc blocks and explicit tactics over fragile automation.
  • NTT Migration: Reintroduces AdditiveNTT.lean with updated indexing in preparation for CompPoly migration.

Note: The diff was too large and was truncated.


Statistics

Metric Count
📝 Files Changed 53
Lines Added 39876
Lines Removed 3935

Lean Declarations

✏️ **Removed:** 77 declaration(s)
  • theorem relayOracleReduction_perfectCompleteness (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def oracleFoldingConsistencyProp (i : Fin (ℓ + 1)) (challenges : Fin i → L) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def foldKnowledgeStateFunction (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def extractNextSuffixFromChallenge (v : sDomain 𝔽q β h_ℓ_add_R_rate ⟨0, by omega⟩) in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • def foldPrvState (i : Fin ℓ) : Fin (2 + 1) → Type in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def getNextOracle (i : Fin (ℓ + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • theorem finalSumcheckOracleReduction_perfectCompleteness {σ : Type} in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def finalNonDoomedFoldingProp {h_le : ϑ ≤ ℓ} in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def roundRelationProp (i : Fin (ℓ + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • abbrev MultilinearPoly (L : Type) [CommSemiring L] (ℓ : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • theorem foldOracleVerifier_rbrKnowledgeSoundness (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def witnessStructuralInvariant {i : Fin (ℓ + 1)} (stmt : Statement (L in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma nonDoomedFoldingProp_relay_preserved (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def finalSumcheckRelOutProp in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def foldKStateProp {i : Fin ℓ} (m : Fin (2 + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def queryCodeword (j : Fin (toOutCodewordsCount ℓ ϑ (Fin.last ℓ))) in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • theorem relayOracleVerifier_rbrKnowledgeSoundness (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def proximityChecksSpec (γ_challenges : in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • def badEventExistsProp in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def fiberwiseDistance (i : Fin ℓ) (steps : ℕ) [NeZero steps] (h_i_add_steps : i.val + steps ≤ ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • abbrev fullInputRelation in ArkLib/ProofSystem/Binius/RingSwitching/General.lean
  • def finalSumcheckRelOut : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def challengeTensorProduct (steps : ℕ) (r_challenges : Fin steps → L) : Vector L (2 ^ steps) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def nonDoomedFoldingProp (i : Fin (ℓ + 1)) (challenges : Fin i → L) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • abbrev fullOutputRelation in ArkLib/ProofSystem/Binius/RingSwitching/General.lean
  • def foldStepRelOut (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def queryRbrKnowledgeError in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • theorem foldOracleReduction_perfectCompleteness (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def BBF_eq_multiplier (r : Fin ℓ → L) : MultilinearPoly L ℓ in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma getFoldingChallenges_init_succ_eq (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def getMidCodewords {i : Fin (ℓ + 1)} (t : L⦃≤ 1⦄[X Fin ℓ]) -- original polynomial t in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def BBF_SumcheckMultiplierParam : SumcheckMultiplierParam L ℓ (SumcheckBaseContext L ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def fiberwiseDisagreementSet (i : Fin ℓ) (steps : ℕ) [NeZero steps] in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma oracleWitnessConsistency_relay_preserved in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def localized_fold_eval (i : Fin ℓ) (steps : ℕ) (h_i_add_steps : i + steps ≤ ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def finalSumcheckRbrKnowledgeError : ℝ≥0 in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • lemma oracle_block_k_next_le (i : Fin (ℓ + 1)) (j : Fin (toOutCodewordsCount ℓ ϑ i)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def foldingBadEvent (i : Fin ℓ) (steps : ℕ) [NeZero steps] (h_i_add_steps : i + steps ≤ ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma firstOracleWitnessConsistencyProp_relay_preserved (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def fiberEvaluationMapping (i : Fin r) (steps : ℕ) (h_i_add_steps : i.val + steps < ℓ + 𝓡) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • theorem commitOracleVerifier_rbrKnowledgeSoundness (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def BBF_CodeDistance (ℓ 𝓡 : ℕ) (i : Fin (ℓ + 1)) : ℕ in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def commitKState (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def fiberwiseClose (i : Fin ℓ) (steps : ℕ) [NeZero steps] (h_i_add_steps : i.val + steps ≤ ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def oracleWitnessConsistency in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def foldKnowledgeError (i : Fin ℓ) (_ : (pSpecFold (L in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def baseFoldMatrix (i : Fin r) (h_i : i + 1 < ℓ + 𝓡) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def finalSumcheckKnowledgeError (m : pSpecFinalSumcheckStep (L in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def hammingClose (i : Fin (ℓ + 1)) (f : OracleFunction 𝔽q β in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • theorem commitOracleReduction_perfectCompleteness (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def nonLastBlockOracleReduction (bIdx : Fin (ℓ / ϑ - 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • abbrev MultiquadraticPoly (L : Type) [CommSemiring L] (ℓ : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def commitKStateProp (i : Fin ℓ) (m : Fin (1 + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def foldStepRelOutProp (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def BBF_Code (i : Fin (ℓ + 1)) : Submodule L ((sDomain 𝔽q β h_ℓ_add_R_rate) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • theorem finalSumcheckOracleVerifier_rbrKnowledgeSoundness [Fintype L] {σ : Type} in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def finalSumcheckKStateProp {m : Fin (1 + 1)} (tr : Transcript m (pSpecFinalSumcheckStep (L in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def uniqueClosestCodeword in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def NBlockMessages in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • def getCommitProverFinalOutput (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def relayKStateProp (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def masterKStateProp (stmtIdx : Fin (ℓ + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma farness_implies_non_compliance (i : Fin ℓ) (steps : ℕ) [NeZero steps] in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def commitPrvState (i : Fin ℓ) : Fin (1 + 1) → Type in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def relayKnowledgeStateFunction (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def getFoldingChallenges (i : Fin (ℓ + 1)) (challenges : Fin i → L) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def commitKnowledgeError {i : Fin ℓ} in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • theorem fiberwise_dist_lt_imp_dist_lt_unique_decoding_radius (i : Fin ℓ) (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • abbrev MLPEvalStatement in ArkLib/ProofSystem/Binius/RingSwitching/Prelude.lean
  • def relayPrvState (i : Fin ℓ) : Fin (0 + 1) → Type in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def nonLastBlockOracleVerifier (bIdx : Fin (ℓ / ϑ - 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • def FinalSumcheckWit in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def roundRelation (i : Fin (ℓ + 1)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def disagreementSet (i : Fin ℓ) (steps : ℕ) [NeZero steps] (h_i_add_steps : i.val + steps ≤ ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def relayKnowledgeError (m : pSpecRelay.ChallengeIdx) : ℝ≥0 in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean
  • def sumcheckConsistencyProp {k : ℕ} (sumcheckTarget : L) (H : L⦃≤ 2⦄[X Fin (k)]) : Prop in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def isCompliant (i : Fin (ℓ)) (steps : ℕ) [NeZero steps] in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
✏️ **Added:** 869 declaration(s)
  • lemma qMap_eval_mem_sDomain_succ (i : Fin r) {destIdx : Fin r} in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma prop_4_21_case_1_fiberwise_close (i : Fin ℓ) (steps : ℕ) [NeZero steps] in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Proposition4_21.lean
  • lemma getFoldingChallenges_init_succ_eq (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • abbrev queryBlockIdx (j : Fin (nBlocks (ℓ in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • def commitStepLogic (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • lemma not_jointProximityNat_of_not_jointProximityNat_split in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean
  • lemma simulateQ_simOracle2_lift_liftComp_query_T1 in ArkLib/ToVCVio/Simulation.lean
  • theorem run'_pure_lib [Monad m] [LawfulMonad m] (x : α) (s : σ) : in ArkLib/ToVCVio/Lemmas.lean
  • theorem simulateQ_preserves_safety_stateful in ArkLib/ToVCVio/Simulation.lean
  • lemma simulateQ_simOracle2_liftM in ArkLib/ToVCVio/Simulation.lean
  • lemma mem_support_bind_iff {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • theorem fullOracleVerifier_knowledgeSoundness_sum : in ArkLib/ProofSystem/Binius/RingSwitching/General.lean
  • def relayPrvState (i : Fin ℓ) : Fin (0 + 1) → Type in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Relay.lean
  • lemma foldStep_doom_escape_probability_bound (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • lemma AbstractOStmtIn.toStrictRelInput_subset_toRelInput (aOStmtIn : AbstractOStmtIn L ℓ') : in ArkLib/ProofSystem/Binius/RingSwitching/Prelude.lean
  • lemma challengeTensorExpansionMatrix_mulVec_F₂_eq_Fin_merge_PO2 [CommRing L] (n : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma not_jointProximityNat_of_not_jointProximityNat_evenOdd_split in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean
  • lemma probFailure_vector_mapM_eq_zero in ArkLib/ToVCVio/Simulation.lean
  • def foldStepRelOut (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • theorem probFailure_simulateQ_iff_stateful in ArkLib/ToVCVio/Simulation.lean
  • lemma lemma_4_24_dist_folded_ge_of_last_noncompliant (i_star : Fin ℓ) (steps : ℕ) [NeZero steps] in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/FoldDistance.lean
  • theorem neverFails_simOracle {ι : Type u} (oSpec : OracleSpec ι) in ArkLib/OracleReduction/OracleInterface.lean
  • def nonLastBlocksOracleReduction : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma incrementalBadEventExistsProp_fold_step_backward (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • def sumcheckVerifierStmtOut (stmtIn : Statement (L in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • instance instInhabitedPSpecBatchingChallenge : in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • def relayKnowledgeStateFunction (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Relay.lean
  • lemma dist_to_UDRCodeword_le_uniqueDecodingRadius (i : Fin r) (h_i : i ≤ ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma fold_eq_multilinearCombine_preTensorCombine_step1 in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean
  • lemma mem_support_queryFiberPoints in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • lemma Fin.reindex_reindex_symm {R n m : Type*} [Fintype n] [Fintype m] in ArkLib/Data/Fin/BigOperators.lean
  • lemma point_disagreement_mem_fiberwiseDisagreement in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean
  • def AbstractOStmtIn.toStrictRelInput (aOStmtIn : AbstractOStmtIn L ℓ') : in ArkLib/ProofSystem/Binius/RingSwitching/Prelude.lean
  • def strictFoldStepRelOutProp (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • theorem run'_bind_pure [Monad m] [LawfulMonad m] {s : σ} (x : α) (f : α → StateT σ m β) : in ArkLib/ToVCVio/Lemmas.lean
  • theorem unroll_1_message_reduction_perfectCompleteness_V_to_P in ArkLib/OracleReduction/Completeness.lean
  • lemma prop_4_21_bad_event_probability (i : Fin ℓ) (steps : ℕ) [NeZero steps] in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Proposition4_21.lean
  • theorem unroll_0_message_reduction_perfectCompleteness in ArkLib/OracleReduction/Completeness.lean
  • theorem intermediateNormVpoly_comp_qmap (i : Fin r) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma extractMLP_eq_some_iff_pair_UDRClose (f : (sDomain 𝔽q β h_ℓ_add_R_rate) ⟨0, by omega⟩ → L) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma lemma_4_21_interleaved_word_UDR_far (i : Fin ℓ) (steps : ℕ) [NeZero steps] in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean
  • lemma mem_support_run_mk_iff {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • lemma fiberwiseClose_congr_sourceDomain_index (sourceIdx₁ sourceIdx₂ : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • theorem sDomainFin_bijective (i : Fin r) (h_i : i < ℓ + R_rate) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma incrementalBadEventExistsProp_relay_preserved (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma roundRelation.of_fin_eq {i j : Fin (ℓ + 1)} (h : i = j) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma OptionT.probOutput_none_bind_eq_zero_iff in ArkLib/ToVCVio/Simulation.lean
  • theorem soundness_unroll_runToRound_2_pSpec_2 in ArkLib/OracleReduction/Completeness.lean
  • theorem commitOracleReduction_perfectCompleteness (hInit : NeverFail init) (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Commit.lean
  • theorem probEvent_soundness_goal_unroll_log' in ArkLib/OracleReduction/Completeness.lean
  • lemma run_liftM_run {α} {ι₁ ι₂ : Type} {spec₁ : OracleSpec ι₁} in ArkLib/ToVCVio/Lemmas.lean
  • theorem sumcheckFoldKnowledgeError_le : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma Matrix.from4Blocks_mul_from4Blocks {mTop mBot pLeft pRight nLeft nRight : ℕ} {α : Type*} in ArkLib/Data/Fin/BigOperators.lean
  • def finTwoPowAddTwoPowEquiv (n : ℕ) : Fin (2 ^ n + 2 ^ n) ≃ Fin (2 ^ (n + 1)) in ArkLib/Data/Fin/BigOperators.lean
  • def badSumcheckEventProp (r_i' : L) (h_i h_star : L⦃≤ 2⦄[X]) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma natDegree_intermediateNormVpoly (i : Fin r) {k : ℕ} (h_k : i.val + k ≤ ℓ) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma no_foldingBadEvent_of_no_bad_global in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean
  • def extractUDRCodeword in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • theorem oddRefinement_eq_novel_poly_of_1_leading_suffix (i : Fin r) (h_i : i < ℓ) (v : Fin (2 ^ i.val)) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma goodBlock_last_isCompliant in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean
  • theorem finalSumcheckOracleReduction_perfectCompleteness {σ : Type} in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/FinalSumcheck.lean
  • def extractSuffixFromChallenge (v : sDomain 𝔽q β h_ℓ_add_R_rate ⟨0, by omega⟩) in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • theorem bbf_fullOracleVerifier_rbrKnowledgeSoundness : in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • def bbfMLIOPCS : MLIOPCS L ℓ' where in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • lemma polyToOracleFunc_eq_getFirstOracle in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma BBF_CodeDistance_eq (i : Fin r) (h_i : i ≤ ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma support_OptionT_pure {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • def BBF_SumcheckMultiplierParam : SumcheckMultiplierParam L ℓ (SumcheckBaseContext L ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma probOutput_none_pure_eq_zero {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • instance instFintypePspecCommitChallenge {i : Fin ℓ} : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • theorem castInOut_completeness in ArkLib/OracleReduction/Cast.lean
  • lemma qMap_total_fiber_congr_steps in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma firstOracleWitnessConsistency_unique (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • theorem QueryImpl_append_impl_inr_stateful in ArkLib/ToVCVio/Simulation.lean
  • lemma run_liftComp_eq {ι' : Type w} {spec : OracleSpec ι} {superSpec : OracleSpec ι'} in ArkLib/ToVCVio/Lemmas.lean
  • def queryCodeword (j : Fin (toOutCodewordsCount ℓ ϑ (Fin.last ℓ))) in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma incrementalBadEventExistsProp_commit_step_backward (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma extractMLP_some_of_oracleFoldingConsistency in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/FinalSumcheck.lean
  • def foldKnowledgeStateFunction (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • lemma lt_r_of_lt_ℓ {h_ℓ_add_R_rate : ℓ + 𝓡 < r} {x : ℕ} (h : x < ℓ) : x < r in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma projectToMidSumcheckPoly_succ (t : MultilinearPoly L ℓ) (m : MultilinearPoly L ℓ) (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma mem_ite_singleton {α : Type*} {c : Prop} [Decidable c] {a b x : α} : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • lemma probFailure_liftComp {ι' : Type w} {superSpec : OracleSpec ι'} in ArkLib/ToVCVio/Lemmas.lean
  • theorem simulateQ_preserves_safety in ArkLib/ToVCVio/Simulation.lean
  • lemma hammingDist_le_fiberwiseDistance_mul_two_pow_steps (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • theorem lastBlockOracleVerifier_rbrKnowledgeSoundness : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma index_bound_check {ℓ i steps : ℕ} (j m : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • theorem probEvent_StateT_run_ignore_state {α : Type} in ArkLib/OracleReduction/Completeness.lean
  • lemma support_simulateQ_eq_OracleComp_of_superSpec {ι' : Type} {superSpec : OracleSpec ι'} in ArkLib/ToVCVio/Simulation.lean
  • lemma liftComp_forIn {ι ι' : Type} {spec : OracleSpec ι} {superSpec : OracleSpec ι'} in ArkLib/ToVCVio/Simulation.lean
  • def mkVerifierOStmtOut in ArkLib/OracleReduction/Basic.lean
  • instance instNeZeroNatToOutCodewordsCount : ∀ i, NeZero (toOutCodewordsCount ℓ ϑ i) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def fiberwiseClose (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • def roundRelation (i : Fin (ℓ + 1)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • theorem probFailure_simulateQ_iff_stateful_run' in ArkLib/ToVCVio/Simulation.lean
  • lemma commitStep_j_is_last (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • lemma foldingBadEventAtBlock_snoc_castSucc_eq (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma mem_support_OptionT_pure_run_some_iff {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • lemma extracted_t_poly_eval_eq_final_constant in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/FinalSumcheck.lean
  • def finalSumcheckRelOutProp in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma map_eval_sumToIter_rename_finSum_zero in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • lemma iterated_fold_to_level_ℓ_eval in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • example ϑ = 1 yields (2^{ℓ+𝓡} - 2^{𝓡})/|L| in the bad-event part alone). The one-sided inequality in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • def strictOracleFoldingConsistencyProp (t : MultilinearPoly L ℓ) (i : Fin (ℓ + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • theorem castOutSimple_id in ArkLib/OracleReduction/Cast.lean
  • lemma probFailure_simulateQ_liftQuery_add_none_eq in ArkLib/ToVCVio/Lemmas.lean
  • lemma projectToNextSumcheckPoly_eval_eq (i : Fin ℓ) (Hᵢ : MultiquadraticPoly L (ℓ - i)) (rᵢ : L) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def fold_single_matrix_mul_form (i : Fin r) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • theorem nonLastSingleBlockOracleVerifier_rbrKnowledgeSoundness in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma probFailure_liftM {ι' : Type w} {superSpec : OracleSpec ι'} in ArkLib/ToVCVio/Lemmas.lean
  • lemma constFunc_mem_BBFCode {i : Fin r} (h_i : i ≤ ℓ) (c : L) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma OptionT.exists_rel_path_of_mem_support_forIn_stateful {ι : Type} {spec : OracleSpec ι} in ArkLib/ToVCVio/Simulation.lean
  • lemma Matrix.reindex_vecMul {m n l : Type*} [Fintype m] [Fintype l] in ArkLib/Data/Fin/BigOperators.lean
  • lemma probFailure_liftComp_of_OracleComp_Option {ι' : Type w} {spec : OracleSpec ι} in ArkLib/ToVCVio/Lemmas.lean
  • lemma mem_support_OptionT_map_some {m : Type u → Type v} [Monad m] [HasEvalSPMF m] [LawfulMonad m] in ArkLib/ToVCVio/Lemmas.lean
  • def projTranscriptChallengeInner {T C L : Type} : (T × C × L) → T × C in ArkLib/OracleReduction/Completeness.lean
  • lemma OptionT.probFailure_vector_mapM_eq_zero in ArkLib/ToVCVio/Simulation.lean
  • lemma sDomainBasisVectors_mem_sDomain (i : Fin r) (k : Fin (ℓ + R_rate - i)) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def strictFinalSumcheckRelOutProp in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • theorem nonLastBlocksOracleVerifier_rbrKnowledgeSoundness : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma mem_support_vector_mapM {n} {f : α → OracleComp spec β} {vec : Vector α n} {x : Vector β n} : in ArkLib/ToVCVio/Simulation.lean
  • def bitsOfIndex {n : ℕ} (k : Fin (2 ^ n)) : Fin n → L in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma strictBatchingInputRelation_subset_batchingInputRelation : in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • lemma blockDiagMatrix_mulVec_F₂_eq_Fin_merge_PO2 (n : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma batching_compute_eq_from_hafter in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • def single_point_localized_fold_matrix_form (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def oraclePositionToDomainIndex {i : Fin (ℓ + 1)} in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma getBit_eq_testBit (n k : ℕ) : Nat.getBit k n = 1 ↔ Nat.testBit n k = true in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • def foldStepLogic (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • def sumcheckProverComputeMsg (witIn : SumcheckWitness L ℓ' i.castSucc) : L⦃≤ 2⦄[X] in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • lemma Prover.processRound_P_to_V (j : Fin n) in ArkLib/ToVCVio/Simulation.lean
  • def getBBF_Codeword_poly (i : Fin r) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • def largeFieldInvocationCtxLens : OracleContext.Lens in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • theorem castOutSimple_perfectCompleteness in ArkLib/OracleReduction/Cast.lean
  • def foldRelayKnowledgeError (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma mem_support_bind_bind_map_iff [LawfulMonad m] in ArkLib/ToVCVio/Lemmas.lean
  • theorem simulateQ_preserves_safety_stateful_run'_mk in ArkLib/ToVCVio/Simulation.lean
  • lemma extractMLP_some_of_isCompliant_at_zero in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • theorem probEvent_StateT_run'_eq_tsum in ArkLib/OracleReduction/Completeness.lean
  • lemma single_point_localized_fold_matrix_form_congr_dest_index in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma query_phase_final_fold_eq_constant in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • lemma get_sDomain_first_basis_eq_1 (i : Fin r) (h_i : i < ℓ + R_rate) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • theorem Pr_or_le {α : Type} (D : PMF α) in ArkLib/Data/Probability/Instances.lean
  • def commitKStateProp (i : Fin ℓ) (m : Fin (1 + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Commit.lean
  • theorem castOutSimple_completeness in ArkLib/OracleReduction/Cast.lean
  • lemma strictOracleFoldingConsistency_commitStep in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • lemma mem_support_simulateQ_id'_liftM_query {ι : Type*} {spec : OracleSpec ι} in ArkLib/ToVCVio/Simulation.lean
  • def QueryImpl.lift {ι₁ ι₂ : Type u} {spec₁ : OracleSpec ι₁} {spec₂ : OracleSpec ι₂} in ArkLib/ToVCVio/Simulation.lean
  • def finalSumcheckStepFoldingStateProp {h_le : ϑ ≤ ℓ} in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma Reduction_run_def (reduction : Reduction oSpec StmtIn WitIn StmtOut WitOut pSpec) in ArkLib/ToVCVio/Simulation.lean
  • lemma Transcript.equiv_eval (tr : pSpec.FullTranscript) : in ArkLib/ToVCVio/Simulation.lean
  • def masterStrictKStateProp (aOStmtIn : AbstractOStmtIn L ℓ') (stmtIdx : Fin (ℓ' + 1)) in ArkLib/ProofSystem/Binius/RingSwitching/Prelude.lean
  • lemma simulateQ_forIn {ι ι' : Type} {spec : OracleSpec ι} {superSpec : OracleSpec ι'} in ArkLib/ToVCVio/Simulation.lean
  • lemma foldingBadEventAtBlock_imp_incrementalBadEvent_last in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • instance instInhabitedPSpecFinalSumcheckStepChallenge : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • theorem prob_pow_bound_of_forall in ArkLib/Data/Probability/Instances.lean
  • def bbfAbstractOStmtIn : AbstractOStmtIn L ℓ' where in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • def badBatchingEventProp (y : Fin κ → L) (msg0 s_bar : TensorAlgebra K L) : Prop in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • lemma OptionT.simulateQ_vector_mapM_eq {ι ι' : Type} {spec : OracleSpec ι} in ArkLib/ToVCVio/Simulation.lean
  • lemma intermediateNormVpoly_eval_is_linear_map (i : Fin r) {k : ℕ} (h_k : i.val + k ≤ ℓ) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def disagreementSet (i : Fin r) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma finalSumcheckStep_verifierCheck_passed in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • lemma Witness.of_fin_eq {i j : Fin (ℓ + 1)} (h : i = j) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • theorem tsum_uniform_Pr_eq_Pr in ArkLib/OracleReduction/Completeness.lean
  • lemma batching_pack_unpack_id (t' : MultilinearPoly L ℓ') : in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • theorem basis_repr_of_sDomain_lift (i j : Fin r) (h_j : j < ℓ + R_rate) (h_le : i ≤ j) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma ne_none_of_mem_support_of_probOutput_none_eq_zero in ArkLib/ToVCVio/Lemmas.lean
  • def logical_computeFoldedValue in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma Matrix.map_neg {m n : Type*} {R S : Type*} [Ring R] [Ring S] in ArkLib/Data/Fin/BigOperators.lean
  • theorem soundness_unroll_runToRound_1_V_to_P_pSpec_2 in ArkLib/OracleReduction/Completeness.lean
  • lemma simulateQ_forIn_stateful_run_eq {ι : Type} {spec : OracleSpec ι} in ArkLib/ToVCVio/Simulation.lean
  • theorem soundness_unroll_runToRound_0_pSpec_1_V_to_P in ArkLib/OracleReduction/Completeness.lean
  • lemma OptionT.support_run_simulateQ_eq_of_superSpec {ι' : Type} in ArkLib/ToVCVio/Simulation.lean
  • lemma innerPowSum_add_two_pow_eq_mul_sum_range {ℓ ϑ 𝓡 B : ℕ} [NeZero ℓ] in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • def largeFieldInvocationStmtLens : OracleStatement.Lens in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • lemma mem_support_run_bind_some_iff {α β : Type u} in ArkLib/ToVCVio/Lemmas.lean
  • def mkFromStmtIdxCastSuccOfSucc {ℓ : ℕ} (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma support_forIn_subset_rel in ArkLib/ToVCVio/Simulation.lean
  • def ForInStep.state : ForInStep σ → σ in ArkLib/ToVCVio/Simulation.lean
  • def fiberwiseDisagreementSet (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • theorem unroll_2_message_reduction_perfectCompleteness in ArkLib/OracleReduction/Completeness.lean
  • lemma OptionT.simulateQ_forIn_stateful_comp {ι : Type} {spec : OracleSpec ι} in ArkLib/ToVCVio/Simulation.lean
  • lemma fun_eta_expansion {α β : Type*} (f : α → β) : f = (fun x => f x) in ArkLib/Data/Misc/Basic.lean
  • lemma OptionT.support_failure_run in ArkLib/ToVCVio/Simulation.lean
  • theorem probOutput_eq_PMF_apply in ArkLib/OracleReduction/Completeness.lean
  • theorem iterated_fold_advances_evaluation_poly in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • instance instFintypePSpecQueryMessage : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma sumcheckConsistency_MLPEvalWitness_to_BBF_Witness_of_eval in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • instance instOracleInterfaceMessagePSpecSumcheckRound : in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • lemma challengeTensorExpansion_one [CommRing L] (r : L) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • abbrev liftComp_self [spec.Fintype] [spec.Inhabited] in ArkLib/ToVCVio/Lemmas.lean
  • theorem sumcheckLoopOracleVerifier_rbrKnowledgeSoundness : in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • def Matrix.from4Blocks {mTop nLeft mBot nRight : ℕ} {α : Type*} in ArkLib/Data/Fin/BigOperators.lean
  • instance instInhabitedPSpecSumcheckRoundChallenge : in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • lemma OptionT.simulateQ_liftComp in ArkLib/ToVCVio/Simulation.lean
  • lemma simulateQ_simOracle2_lift_liftComp_query_T2 in ArkLib/ToVCVio/Simulation.lean
  • theorem castInOut_id in ArkLib/OracleReduction/Cast.lean
  • lemma not_badBlock_of_lt_highest in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/BadBlocks.lean
  • def extractMLP (i : Fin ℓ) (f : (sDomain 𝔽q β h_ℓ_add_R_rate) ⟨i, by omega⟩ → L) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def finalSumcheckVerifierStmtOut in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean
  • lemma simulateQ_liftComp in ArkLib/ToVCVio/Simulation.lean
  • lemma multilinearCombine_recursive_form_first {ϑ : ℕ} in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean
  • lemma fun_eta_expansion_apply {α β : Type*} (f : α → β) (x : α) : (f x) = (fun x => f x) x in ArkLib/Data/Misc/Basic.lean
  • def projTranscriptChallenge {T C L S : Type} : ((T × C × L) × S) → T × C in ArkLib/OracleReduction/Completeness.lean
  • lemma simulateQ_simOracle2_liftM_query_T1 in ArkLib/ToVCVio/Simulation.lean
  • theorem foldOracleReduction_perfectCompleteness (hInit : NeverFail init) (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • theorem Polynomial.foldl_comp (n : ℕ) (f : Fin n → L[X]) : ∀ initInner initOuter: L[X], in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def strictFinalSumcheckRelOut : in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma k_succ_mul_ϑ_le_ℓ_₂ {k : Fin (ℓ / ϑ)} : k.val * ϑ + ϑ ≤ ℓ in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • abbrev queryBlockSourceIdx (j : Fin (nBlocks (ℓ in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma singleton_mapM_gen in ArkLib/ToVCVio/Simulation.lean
  • def getNextOracle (i : Fin (ℓ + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • instance instFintypePSpecBatchingChallenge : in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • lemma coe_fin_pow_two_eq_bitsOfIndex {n : ℕ} (k : Fin (2 ^ n)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def foldStepRelOutProp (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • def relayKnowledgeError (m : pSpecRelay.ChallengeIdx) : ℝ≥0 in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Relay.lean
  • lemma fixFirstVariablesOfMQP_zero_eq in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • def strictRoundRelation (i : Fin (ℓ + 1)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • abbrev Stateless {ι ι' : Type*} (spec : OracleSpec ι) (superSpec : OracleSpec ι') in ArkLib/ToVCVio/Simulation.lean
  • lemma support_bind_simulateQ_run'_eq_mk in ArkLib/ToVCVio/Simulation.lean
  • lemma queryBlockDestSuffix_eq_queryBlockSourceSuffix_succ in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • def pair_fiberwiseDistance (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma even_index_intermediate_novel_basis_decomposition (i : Fin r) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma OptionT.support_ite_run in ArkLib/ToVCVio/Simulation.lean
  • lemma foldCommitKnowledgeError_eq (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma multilinearWeight_succ_upper_half {n : ℕ} in ArkLib/Data/CodingTheory/Prelims.lean
  • lemma OptionT.exists_path_of_mem_support_forIn_unit {σ α : Type} [spec.Fintype] in ArkLib/ToVCVio/Simulation.lean
  • lemma foldStep_rbrExtractionFailureEvent_imply_sumcheck_or_badEvent (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • lemma projectToMidSumcheckPoly_at_last_eq in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma OptionT.mem_support_vector_mapM {ι : Type} {spec : OracleSpec ι} in ArkLib/ToVCVio/Simulation.lean
  • def largeFieldInvocationExtractorLens : Extractor.Lens in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • def additiveNTTInvariant (evaluation_buffer : Fin (2 ^ (ℓ + R_rate)) → L) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma finalSumcheckKnowledgeError_sum_eq_zero : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • def getLastOracle {oracleFrontierIdx : Fin (ℓ + 1)} {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma iterated_fold_congr_dest_index in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def splitEvenOddRowWiseInterleavedWords {ϑ : ℕ} in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean
  • theorem commitOracleVerifier_rbrKnowledgeSoundness (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Commit.lean
  • lemma iterated_fold_to_const_strict in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean
  • def batchingVerifierCheck (stmtIn : BatchingStmtIn L ℓ) (msg0 : TensorAlgebra K L) : Prop in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • lemma probFailure_forIn_of_relations_simplified in ArkLib/ToVCVio/Simulation.lean
  • lemma qMap_comp_normalizedW (i : Fin r) (h_i_add_1 : i + 1 < r) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • abbrev nBlocks : ℕ in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma getSDomainBasisCoeff_of_iteratedQuotientMap in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma oracle_block_k_le_i (i : Fin (ℓ + 1)) (j : Fin (toOutCodewordsCount ℓ ϑ i)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma val_le_i {ℓ : ℕ} (i : Fin (ℓ + 1)) (oracleIdx : OracleFrontierIndex i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • theorem qMap_maps_sDomain (i : Fin r) (h_i_add_1 : i + 1 < r) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma fin_zero_mul_eq (h : 0 * ϑ < ℓ + 1) : (⟨0 * ϑ, h⟩ : Fin (ℓ + 1)) = 0 in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma single_point_localized_fold_matrix_form_congr_steps_index in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma neverFail_map_iff' [spec.Fintype] [spec.Inhabited] in ArkLib/ToVCVio/Lemmas.lean
  • def foldVerifierCheck (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • def getChallengeSuffix (k : Fin (ℓ / ϑ)) (v : sDomain 𝔽q β h_ℓ_add_R_rate ⟨0, by omega⟩) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma snoc_oracle_eq_mkVerifierOStmtOut_commitStep in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • lemma Transcript_get_message (tr : pSpec.FullTranscript) (j : Fin n) (h : pSpec.dir j = .P_to_V) : in ArkLib/ToVCVio/Simulation.lean
  • lemma mem_support_OptionT_run_map_some in ArkLib/ToVCVio/Lemmas.lean
  • def Nat.boundedRecOn {r : ℕ} {motive : (k : ℕ) → k < r → Sort _} in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma probFailure_simulateQ_iff_mk in ArkLib/ToVCVio/Simulation.lean
  • lemma nonLastSingleBlockOracleReduction_perfectCompleteness in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • def incrementalFoldingBadEvent in ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean
  • lemma strictRoundRelation.of_fin_eq {i j : Fin (ℓ + 1)} (h : i = j) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • def fullRbrKnowledgeError in ArkLib/ProofSystem/Binius/FRIBinius/General.lean
  • lemma simOracle2_impl_inr_inr in ArkLib/ToVCVio/Simulation.lean
  • lemma support_OptionT_pure_run {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • theorem qMap_is_linear_map (i : Fin r) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma instOracleStatementBinaryBasefold_heq_of_fin_eq {i₁ i₂ : Fin (ℓ + 1)} (h : i₁ = i₂) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • theorem probFailure_simulateQ_iff_stateful_run'_mk in ArkLib/ToVCVio/Simulation.lean
  • lemma OptionT.simulateQ_vector_mapM {ι ι' : Type} {spec : OracleSpec ι} {superSpec : OracleSpec ι'} in ArkLib/ToVCVio/Simulation.lean
  • lemma batchingMismatchPoly_nonzero_of_embed_ne in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • lemma support_simulateQ_bind_run_eq in ArkLib/ToVCVio/Simulation.lean
  • lemma foldBadEventCardSum_eq_displaySums in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma iteratedQuotientMap_eq_qMap_total_fiber_extractMiddleFinMask in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • instance instMonadLift_left_right {ι₁ ι₂ ι₃ : Type} in ArkLib/ToVCVio/Simulation.lean
  • instance instInhabitedPSpecFoldChallenge : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • theorem probEvent_proj_transcript_challenge in ArkLib/OracleReduction/Completeness.lean
  • lemma fold_error_containment_of_UDRClose (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean
  • theorem Polynomial.comp_same_inner_eq_if_same_outer (f g : L[X]) (h_f_eq_g : f = g) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def getRowPoly (i : Fin ℓ) (steps : ℕ) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean
  • def nonLastSingleBlockFoldRelayRbrKnowledgeError (bIdx : Fin (ℓ / ϑ - 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • theorem evenRefinement_eq_novel_poly_of_0_leading_suffix (i : Fin r) (h_i : i < ℓ) (v : Fin (2 ^ i.val)) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma projectToMidSumcheckPoly_eq_prod (t : MultilinearPoly L ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def getLiftPoly (i : Fin ℓ) (steps : ℕ) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean
  • instance instInhabitedPSpecFinalSumcheckMessage : in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • lemma oracle_index_le_ℓ (i : Fin (ℓ + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma probFailure_bind_pure_comp_eq_zero_iff {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • instance instFintypePspecCommit_AllChallenges {i : Fin ℓ} : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • def coeffsBySuffix (a : Fin (2 ^ ℓ) → L) (i : Fin r) (h_i : i ≤ ℓ) (v : Fin (2 ^ i.val)) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma simOracle2_impl_inl in ArkLib/ToVCVio/Simulation.lean
  • lemma eval_point_ω_eq_next_twiddleFactor_comp_qmap in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma finalSumcheckStep_is_logic_complete : in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • lemma logical_checkSingleRepetition_guard_eq in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma simulateQ_simOracle2_liftM_query_T2 in ArkLib/ToVCVio/Simulation.lean
  • lemma support_liftComp {ι' : Type w} {superSpec : OracleSpec ι'} in ArkLib/ToVCVio/Lemmas.lean
  • lemma Matrix.reindex_mul_eq_prod_of_reindex {l m n o p q : Type*} in ArkLib/Data/Fin/BigOperators.lean
  • lemma qMap_total_fiber_congr_source in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma probFailure_liftComp_eq {ι' : Type} {superSpec : OracleSpec ι'} in ArkLib/ToVCVio/Lemmas.lean
  • theorem intermediateChangeOfBasisMatrix_lower_triangular (i : Fin r) (h_i : i ≤ ℓ) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def Fin.reindex {R n m : Type*} [Fintype n] [Fintype m] (e : n ≃ m) (v : n → R) in ArkLib/Data/Fin/BigOperators.lean
  • lemma sumcheckConsistency_at_last_simplifies in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean
  • def logical_checkSingleFoldingStep in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • def finalSumcheckKnowledgeError (m : pSpecFinalSumcheckStep (L in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/FinalSumcheck.lean
  • lemma prop_4_21_2_incremental_bad_event_probability in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean
  • instance instNontrivial {F ι : Type*} {n : ℕ} [Field F] [Fintype ι] {α : ι ↪ F} in ArkLib/Data/CodingTheory/ReedSolomon.lean
  • theorem fullOracleVerifier_knowledgeSoundness : in ArkLib/ProofSystem/Binius/FRIBinius/General.lean
  • instance instInhabitedPSpecSumcheckRoundMessage : in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • lemma eval_eqPolynomial_bitsOfIndex [DecidableEq L] [IsDomain L] in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma Matrix.reindex_vecMul_reindex {m n o l : Type*} [Fintype n] [Fintype l] [Fintype m] in ArkLib/Data/Fin/BigOperators.lean
  • abbrev queryBlockDestSuffix in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma OptionT.simulateQ_list_mapM {ι ι' : Type} {spec : OracleSpec ι} {superSpec : OracleSpec ι'} in ArkLib/ToVCVio/Simulation.lean
  • abbrev queryBlockDestIdx (j : Fin (nBlocks (ℓ in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma sum_powers (x B : ℕ) (hB : 1 ≤ B) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • theorem intermediateChangeOfBasisMatrix_det_ne_zero (i : Fin r) (h_i : i ≤ ℓ) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • theorem relayOracleVerifier_rbrKnowledgeSoundness (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Relay.lean
  • def FullTranscript.mk1 {pSpec : ProtocolSpec 1} (msg0 : pSpec.«Type» 0) : in ArkLib/OracleReduction/Basic.lean
  • lemma base_coeffsBySuffix (a : Fin (2 ^ ℓ) → L) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma probFailure_forIn_eq_zero_of_body_safe in ArkLib/ToVCVio/Simulation.lean
  • lemma support_vector_mapM_gen in ArkLib/ToVCVio/Simulation.lean
  • theorem singleRepetition_proximityCheck_bound in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • lemma get_sDomain_basis (i : Fin r) (h_i : i < ℓ + R_rate) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma getMidCodewords_succ (t : L⦃≤ 1⦄[X Fin ℓ]) (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma lastRoundChallengeSlice_heq in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • def finalSumcheckRelOut : in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma probOutput_none_pure_some_eq_zero in ArkLib/ToVCVio/Lemmas.lean
  • def sBasis (i : Fin r) (h_i : i < ℓ + R_rate) : Fin (ℓ + R_rate - i) → L in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def foldingBadEvent (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean
  • lemma iteratedSumcheck_rbrExtractionFailureEvent_imply_badSumcheck (i : Fin ℓ') in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • lemma neverFails_of_simulateQ_stateful in ArkLib/ToVCVio/Simulation.lean
  • def finalSumcheckStepLogic : in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • abbrev IntermediateCoeffVecSpace (i : Fin r) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma mem_support_StateT_bind_run {σ α β : Type} in ArkLib/ToVCVio/Simulation.lean
  • lemma logical_checkSingleRepetition_of_mem_support_forIn_body {σ : Type} in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • lemma goodBlockCodeword_eq_of_fiberwiseClose in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean
  • lemma probFailure_mk_do_bind_bind_eq_zero_iff {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • def strictBatchingInputRelation : in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • def splitFinMap_PO2_right {L : Type*} {n : ℕ} (v : Fin (2 ^ (n + 1)) → L) in ArkLib/Data/Fin/BigOperators.lean
  • lemma mem_support_map_iff_generic {m : Type u → Type v} [Monad m] [HasEvalSPMF m] [LawfulMonad m] in ArkLib/ToVCVio/Lemmas.lean
  • instance instInhabitedOracleStatement {i : Fin (ℓ + 1)} : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma foldStep_oracleWitnessConsistency_unique_witMid (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • def splitPointIntoCoeffs (i : Fin r) (h_i : i < ℓ + R_rate) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def foldKStateProp {i : Fin ℓ} (m : Fin (2 + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • def badBlockProp in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/BadBlocks.lean
  • instance instOracleInterfacePSpecRelay_AllChallenges in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • theorem support_nonempty_of_neverFails in ArkLib/ToVCVio/Simulation.lean
  • lemma fold_eval_fiber₂_eq_mat_mat_vec_mul (i : Fin r) {midIdx destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • theorem fullOracleVerifier_rbrKnowledgeSoundness : in ArkLib/ProofSystem/Binius/FRIBinius/General.lean
  • lemma sDomain_card (i : Fin r) (h_i : i < ℓ + R_rate) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma mergeFinMap_PO2_of_split_left_right {L : Type*} {n : ℕ} (v : Fin (2 ^ (n + 1)) → L) : in ArkLib/Data/Fin/BigOperators.lean
  • def isCompliant (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean
  • abbrev MultiquadraticPoly (L : Type) [CommSemiring L] (ℓ : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def logical_checkSingleRepetition in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • theorem base_intermediateNormVpoly in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma fiberwiseClose_steps_zero_iff_UDRClose in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma val_mkFromStmtIdx {ℓ : ℕ} (stmtIdx : Fin (ℓ + 1)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • instance instFintypePSpecFold_AllChallenges : ∀ i, Fintype ((pSpecFold (L in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma Polynomial.toMvPolynomial_ne_zero_iff (p : Polynomial R) (i : σ) : in ArkLib/ToMathlib/MvPolynomial/Equiv.lean
  • lemma probOutput_none_bind_eq_zero_iff in ArkLib/ToVCVio/Simulation.lean
  • lemma batchingMismatchPoly_totalDegree_le in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • lemma preTensorCombine_of_lift_interleavedCodeword_eq_self (i : Fin ℓ) (steps : ℕ) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean
  • lemma commitStep_j_bound (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • lemma butterflyMatrix_zero_apply (z₀ z₁ : L) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def MLPEvalWitness_to_BBF_Witness (stmt : MLPEvalStatement (L in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • lemma disagreement_fold_subset_fiberwiseDisagreement (i : Fin ℓ) (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/FoldDistance.lean
  • lemma k_succ_mul_ϑ_le_ℓ {k : Fin (ℓ / ϑ)} : (k.val + 1) * ϑ ≤ ℓ in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma fiberwiseClose_fold_implies_affineLineEval_close in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean
  • lemma extractSuffixFromChallenge_congr_destIdx in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • def querySingleRepetitionError : ℝ≥0 in ArkLib/ProofSystem/Binius/FRIBinius/General.lean
  • lemma h_oracle_size_eq_relay (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Relay.lean
  • lemma map_pure (f : α → β) (a : α) : in ArkLib/ToVCVio/Simulation.lean
  • lemma mkLastOracleIndex_eq_getLastOraclePositionIndex (i : Fin (ℓ + 1)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def foldKnowledgeError (i : Fin ℓ) (_ : (pSpecFold (L in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • lemma OptionT.simulateQ_simOracle2_liftM_query_T1 in ArkLib/ToVCVio/Simulation.lean
  • lemma foldStep_is_logic_complete (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • lemma highestBadBlock_is_bad in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/BadBlocks.lean
  • lemma getSumcheckRoundPoly_sum_eq (i : Fin ℓ) (h : ↥L⦃≤ 2⦄[X Fin (ℓ - ↑i.castSucc)]) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma odd_index_intermediate_novel_basis_decomposition in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def strictSumcheckRoundRelationProp (aOStmtIn : AbstractOStmtIn L ℓ') (i : Fin (ℓ' + 1)) in ArkLib/ProofSystem/Binius/RingSwitching/Prelude.lean
  • lemma incrementalFoldingBadEvent_of_k_eq_0_is_false in ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean
  • lemma neverFails_of_simulateQ_mk in ArkLib/ToVCVio/Simulation.lean
  • def intermediateToCoeffsVec (i : Fin r) : -- (h_i : i ≤ ℓ) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def reindexVecTwoPowAddTwoPow {L : Type*} {n : ℕ} (v : Fin (2 ^ n + 2 ^ n) → L) in ArkLib/Data/Fin/BigOperators.lean
  • lemma simOracle2_impl_inr_inl in ArkLib/ToVCVio/Simulation.lean
  • instance instFintypePSpecSumcheckRoundChallenge : in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • theorem run_liftM_lib [Monad m] [LawfulMonad m] (ma : m α) (s : σ) : in ArkLib/ToVCVio/Lemmas.lean
  • lemma Matrix.vecMul_reindex {m n o l : Type*} [Fintype m] [Fintype o] [Fintype n] [Fintype l] in ArkLib/Data/Fin/BigOperators.lean
  • lemma fixFirstVariablesOfMQP_full_eval_eq_eval {deg : ℕ} {challenges : Fin (Fin.last ℓ) → L} in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma sDomain_eq_of_eq {i j : Fin r} (h : i = j) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma UDRCodeword_constFunc_eq_self (i : Fin r) (h_i : i ≤ ℓ) (c : L) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma mem_support_bind_some_iff {α β : Type u} in ArkLib/ToVCVio/Lemmas.lean
  • def iteratedSumcheckWitMid (i : Fin ℓ') : Fin (2 + 1) → Type in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • instance instFintypePSpecFinalSumcheckStepMessage : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma OptionT.simulateQ_array_mapM {ι ι' : Type} {spec : OracleSpec ι} {superSpec : OracleSpec ι'} in ArkLib/ToVCVio/Simulation.lean
  • instance instFintypeOracleSpecEmpty : (([]ₒ : OracleSpec PEmpty).Fintype) where in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma mkVerifierOStmtOut_inr in ArkLib/OracleReduction/Basic.lean
  • def getLastOraclePositionIndex (i : Fin (ℓ + 1)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def getCommitProverFinalOutput (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Commit.lean
  • instance instMonadLift_right_left {ι₁ ι₂ ι₃ : Type} in ArkLib/ToVCVio/Simulation.lean
  • lemma snoc_oracle_dest_eq_j {i : Fin ℓ} {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma iteratedQuotientMap_eq_qMap_total_fiber_extractMiddleFinMask in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • def pair_UDRClose (i : Fin r) (h_i : i ≤ ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • theorem fullOracleVerifier_knowledgeSoundness (ε_pcs : ℝ≥0) in ArkLib/ProofSystem/Binius/RingSwitching/General.lean
  • instance instMonadLift_left_left {ι₁ ι₂ ι₃ : Type} in ArkLib/ToVCVio/Simulation.lean
  • theorem prop_4_23_singleRepetition_proximityCheck_bound in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean
  • def hEq {ιₒᵢ ιₒₒ : Type} {OracleIn : ιₒᵢ → Type} in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • theorem fullRbrKnowledgeError_sum_eq_concrete (ε_pcs : ℝ≥0) in ArkLib/ProofSystem/Binius/RingSwitching/General.lean
  • lemma probOutput_none_run_eq_zero_of_probFailure_eq_zero in ArkLib/ToVCVio/Lemmas.lean
  • lemma getFiberPoint_eq_qMap_total_fiber in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma support_challengeQueryImpl_run_eq {n : ℕ} {pSpec : ProtocolSpec n} {σ : Type} in ArkLib/ToVCVio/Simulation.lean
  • def fold_error_containment (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean
  • theorem relayOracleReduction_perfectCompleteness (hInit : NeverFail init) (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Relay.lean
  • lemma pair_fiberwiseDistance_steps_zero_eq_hammingDist in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma exists_eq_some_of_mem_support_run_of_probFailure_eq_zero in ArkLib/ToVCVio/Lemmas.lean
  • theorem probEvent_soundness_goal_unroll_log in ArkLib/OracleReduction/Completeness.lean
  • lemma mem_support_mk {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • lemma iterated_fold_zero_steps (i : Fin r) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma getLastOracleDomainIndex_add_ϑ_le (i : Fin (ℓ + 1)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def roundRelationProp (i : Fin (ℓ + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma getSDomainBasisCoeff_of_sum_repr [NeZero R_rate] (i : Fin r) (h_i : i ≤ ℓ) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma neverFail_vector_mapM in ArkLib/ToVCVio/Simulation.lean
  • lemma compute_A_MLE_eval_eq_final_eq_value in ArkLib/ProofSystem/Binius/RingSwitching/Prelude.lean
  • instance instFintypePSpecFoldChallenge : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • def foldStepWitBeforeFromWitMid (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • lemma probability_bound_badBatchingEventProp in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • def strictRoundRelationProp (i : Fin (ℓ + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma previousSuffix_eq_getFiberPoint_extractMiddleFinMask in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • def largeFieldInvocationOracleReduction : in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • theorem forall_eq_lift_mem_2 {α β γ} {S : Set α} {T : α → Set β} in ArkLib/OracleReduction/Completeness.lean
  • lemma logical_computeFoldedValue_eq_iterated_fold in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • def pair_fiberwiseClose (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • def finalSumcheckVerifierCheck in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean
  • theorem castInOut_perfectCompleteness in ArkLib/OracleReduction/Cast.lean
  • lemma Matrix.det_from4Blocks_of_squareSubblocks_commute {n : ℕ} {R : Type*} in ArkLib/Data/Fin/BigOperators.lean
  • def nonLastBlocksRbrKnowledgeError in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma query_phase_consistency_guard_safe in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • lemma OptionT.simulateQ_bind_stateful {ι : Type} {spec : OracleSpec ι} in ArkLib/ToVCVio/Simulation.lean
  • lemma projectToMidSumcheckPoly_at_last_eval in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def commitStepLogic_embed_inj (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • def strictfinalSumcheckStepFoldingStateProp (t : MultilinearPoly L ℓ) {h_le : ϑ ≤ ℓ} in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • theorem prob_pow_of_forall_finFun in ArkLib/Data/Probability/Instances.lean
  • def strictFoldStepRelOut (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma MLPEvalRelation_of_round0_local_and_structural in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • lemma Matrix.from4Blocks_eq_fromBlocks {m n : ℕ} {α : Type*} in ArkLib/Data/Fin/BigOperators.lean
  • lemma UDRClose_of_fin_eq {i j : Fin r} (hij : i = j) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma multilinearWeight_bitsOfIndex_eq_indicator {n : ℕ} (j k : Fin (2 ^ n)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean
  • lemma probFailure_challengeQueryImpl_run {n : ℕ} {pSpec : ProtocolSpec n} {σ : Type} in ArkLib/ToVCVio/Simulation.lean
  • lemma prob_uniform_suffix_mem in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/BadBlocks.lean
  • lemma successor_codeword_eval_eq in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma mapOStmtOut_eq_mkVerifierOStmtOut_relayStep in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Relay.lean
  • def OracleFrontierIndex {ℓ : ℕ} (stmtIdx : Fin (ℓ + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma queryBlockDestIdx_eq_queryBlockSourceIdx_succ in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • theorem fullRbrKnowledgeError_sum_eq_front_add_pcs : in ArkLib/ProofSystem/Binius/RingSwitching/General.lean
  • def witnessStructuralInvariant {i : Fin (ℓ + 1)} (stmt : Statement (L in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • def strictSumcheckRoundRelation (aOStmtIn : AbstractOStmtIn L ℓ') (i : Fin (ℓ' + 1)) : in ArkLib/ProofSystem/Binius/RingSwitching/Prelude.lean
  • lemma OptionT.mem_support_run_vector_mapM_some {ι : Type} {spec : OracleSpec ι} in ArkLib/ToVCVio/Simulation.lean
  • instance instInhabitedPSpecRelayChallenge : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma prop_4_21_2_case_2_fiberwise_far_incremental in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean
  • theorem soundness_error_mono in ArkLib/OracleReduction/Security/Basic.lean
  • lemma strictSumcheckRoundRelation_subset_sumcheckRoundRelation (aOStmtIn : AbstractOStmtIn L ℓ') in ArkLib/ProofSystem/Binius/RingSwitching/Prelude.lean
  • lemma queryBlockDestIdx_le in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma degree_intermediateNormVpoly (i : Fin r) {k : ℕ} (h_k : i.val + k ≤ ℓ) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def finalSumcheckProverComputeMsg in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean
  • lemma probFailure_mk_do_bindT_eq_zero_iff {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • lemma goodBlock_intermediate_isCompliant in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean
  • def nonLastSingleBlockOracleVerifier (bIdx : Fin (ℓ / ϑ - 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • theorem probOutput_uniform_eq_Pr in ArkLib/OracleReduction/Completeness.lean
  • def logical_queryFiberPoints in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma exists_path_of_mem_support_forIn_unit {σ α : Type} [spec.Fintype] in ArkLib/ToVCVio/Simulation.lean
  • lemma batching_compute_s0_eq_eval_MLE in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • lemma UDRCodeword_mem_BBF_Code (i : Fin r) (h_i : i ≤ ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • instance instFintypePSpecRelay_AllChallenges : ∀ i, Fintype ((pSpecRelay).Challenge i) in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma simulateQ_list_mapM {ι ι' : Type} {spec : OracleSpec ι} {superSpec : OracleSpec ι'} in ArkLib/ToVCVio/Simulation.lean
  • lemma fixFirstVariablesOfMQP_eq_bind₁ (v : Fin (ℓ + 1)) (poly : MvPolynomial (Fin ℓ) L) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma preTensorCombine_row_eq_fold_with_binary_row_challenges in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean
  • lemma incrementalFoldingBadEvent_eq_foldingBadEvent_of_k_eq_ϑ in ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean
  • instance instFintypePSpecFinalSumcheckChallenge : in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • def finalSumcheckStepOracleConsistencyProp {h_le : ϑ ≤ ℓ} in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma getLastOracleDomainIndex_last : getLastOracleDomainIndex ℓ ϑ (Fin.last ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def OracleAwareReductionLogicStep.IsStronglyCompleteUnderSimulation in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • lemma exists_eq_some_of_mem_support_of_probOutput_none_eq_zero in ArkLib/ToVCVio/Lemmas.lean
  • lemma affineProximityGap_RS_interleaved_contrapositive in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean
  • lemma 𝔽q_element_eq_zero_or_eq_one : ∀ c: 𝔽q, c = 0 ∨ c = 1 in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma oracleFoldingConsistencyProp_relay_preserved (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • theorem intermediateNormVpoly_comp (i : Fin r) {destIdx : Fin r} in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma preTensorCombine_jointProximityNat_of_fiberwiseClose (i : Fin ℓ) (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean
  • theorem qMap_total_fiber_injective (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • abbrev goodBlockCodeword in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean
  • lemma mem_support_simulateQ_id'_liftM_query {ι : Type*} {spec : OracleSpec ι} in ArkLib/ToVCVio/Lemmas.lean
  • lemma folded_lifted_IC_eq_IC_row_polyToOracleFunc (i : Fin ℓ) (steps : ℕ) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean
  • lemma sumcheckConsistency_at_last_simplifies in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • lemma exists_BBF_poly_of_codeword (i : Fin r) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • def sumcheckStepLogic : in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • lemma mem_support_run_iff {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • lemma foldStepHStarFromWitMid_eq_of_oracleWitnessConsistency (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • lemma challengeTensorExpansion_decompose_succ [CommRing L] (n : ℕ) (r : Fin (n + 1) → L) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma support_simulateQ_eq (so : QueryImpl spec ProbComp) (oa : OracleComp spec α) in ArkLib/ToVCVio/Simulation.lean
  • lemma simulateQ_array_mapM {ι ι' : Type} {spec : OracleSpec ι} {superSpec : OracleSpec ι'} in ArkLib/ToVCVio/Simulation.lean
  • lemma strictRoundRelation_relay_preserved (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Relay.lean
  • lemma UDRCodeword_eval_eq_of_fin_eq in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma sum_range_pred_eq_sum_Icc {B : ℕ} (f : ℕ → ℕ) (hB : 1 ≤ B) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • instance instInhabitedOracleSpecEmpty : (([]ₒ : OracleSpec PEmpty).Inhabited) where in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • lemma Matrix.det_map_ringHom {n : Type*} [Fintype n] [DecidableEq n] {R S : Type*} in ArkLib/Data/Fin/BigOperators.lean
  • theorem soundness_unroll_runToRound_1_P_to_V_pSpec_2 in ArkLib/OracleReduction/Completeness.lean
  • lemma mem_sDomain_of_eq {i j : Fin r} (h : i.val = j.val) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma Matrix.reindex_mulVec {m n o l : Type*} [Fintype n] [Fintype l] [Fintype m] [Fintype o] in ArkLib/Data/Fin/BigOperators.lean
  • def UDRClose (i : Fin r) (h_i : i ≤ ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • def strictOracleWitnessConsistency in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma Transcript_get_challenge (tr : pSpec.FullTranscript) (j : Fin n) (h : pSpec.dir j = .V_to_P) : in ArkLib/ToVCVio/Simulation.lean
  • lemma eq_split_finMap_PO2_iff_merge_finMap_PO2_eq {L : Type*} {n : ℕ} (v : Fin (2 ^ (n + 1)) → L) in ArkLib/Data/Fin/BigOperators.lean
  • lemma Prover.run_succ (prover : Prover oSpec StmtIn WitIn StmtOut WitOut pSpec) in ArkLib/ToVCVio/Simulation.lean
  • def tileCoeffs (a : Fin (2 ^ ℓ) → L) : Fin (2^(ℓ + R_rate)) → L in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def foldProverComputeMsg (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma finalSumcheck_honest_message_eq_t'_eval in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • lemma probFailure_mk_bind_eq_zero_iff {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • lemma Prover.processRound_V_to_P (j : Fin n) in ArkLib/ToVCVio/Simulation.lean
  • lemma mem_support_OptionT_bind_some {m : Type u → Type v} [Monad m] [HasEvalSPMF m] [LawfulMonad m] in ArkLib/ToVCVio/Lemmas.lean
  • lemma foldl_NTTStage_inductive_aux (h_ℓ : ℓ ≤ r) (k : Fin (ℓ + 1)) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def finalSumcheckVerifierCheck in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • lemma probFailure_mk_do_bind_eq_zero_iff {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • lemma probFailure_simulateQ_iff (so : QueryImpl spec ProbComp) (oa : OracleComp spec α) : in ArkLib/ToVCVio/Simulation.lean
  • lemma Matrix.reindex_mulVec_reindex {m n o l : Type*} [Fintype n] [Fintype l] [Fintype m] in ArkLib/Data/Fin/BigOperators.lean
  • lemma probFailure_simulateQ_liftQuery_eq in ArkLib/ToVCVio/Lemmas.lean
  • lemma queryBlockSourceIdx_le in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma OptionT.probFailure_forIn_eq_zero_of_body_safe in ArkLib/ToVCVio/Simulation.lean
  • lemma simulateQ_forIn_stateful_comp {ι : Type} {spec : OracleSpec ι} in ArkLib/ToVCVio/Simulation.lean
  • def sumcheckProverWitOut (_stmtIn : Statement (L in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • lemma sum_fin_eq_sum_Icc_pred {B : ℕ} (f : ℕ → ℕ) (hB : 1 ≤ B) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • def commitStepHEq (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • instance instInhabitedPSpecFold_AllChallenges : ∀ i, Inhabited ((pSpecFold (L in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • abbrev MultilinearPoly (L : Type) [CommSemiring L] (ℓ : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma support_run_simulateQ_run_fst_eq {ι : Type} in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • theorem probEvent_simulateQ_run_ignore_state {α : Type} in ArkLib/OracleReduction/Completeness.lean
  • instance instFintypePSpecFinalSumcheckStepChallenge : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma probFailure_run_simulateQ_liftQuery_eq in ArkLib/ToVCVio/Lemmas.lean
  • lemma support_StateT_ite_apply {σ α : Type} in ArkLib/ToVCVio/Simulation.lean
  • lemma goodBlock_implies_currentUDRClose in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean
  • lemma lt_r_of_le_ℓ {h_ℓ_add_R_rate : ℓ + 𝓡 < r} {x : ℕ} (h : x ≤ ℓ) : x < r in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma OptionT.bind_pure_simulateQ_comp in ArkLib/ToVCVio/Simulation.lean
  • theorem castOutSimple_rbrKnowledgeSoundness in ArkLib/OracleReduction/Cast.lean
  • lemma badEventExistsProp_iff_incrementalBadEventExistsProp_last in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma OracleComp.liftM_query_eq_liftM_liftM.{u, v, z} in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • instance instFintypePSpecRelayChallenge : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma mem_support_OptionT_run_bind_some in ArkLib/ToVCVio/Lemmas.lean
  • def nonLastBlocksOracleVerifier : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • def finalSumcheckKnowledgeError (m : pSpecFinalSumcheckStep (L in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • theorem bbf_fullOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • lemma natDegree_qMap (i : Fin r) : (qMap 𝔽q β i).natDegree = 2 in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma multilinearWeight_succ_lower_half {n : ℕ} in ArkLib/Data/CodingTheory/Prelims.lean
  • lemma liftComp_id in ArkLib/ToVCVio/Lemmas.lean
  • instance instInhabitedPSpecRelayMessage : [(pSpecRelay).Message]ₒ.Inhabited where in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • theorem fullOracleVerifier_knowledgeSoundness : in ArkLib/ProofSystem/Binius/BinaryBasefold/General.lean
  • lemma degree_qMap (i : Fin r) : (qMap 𝔽q β i).degree = 2 in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma firstOracleWitnessConsistencyProp_unique (t₁ t₂ : MultilinearPoly L ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • def logical_proximityChecksSpec in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma probEvent_mk {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • lemma val_mkFromStmtIdxCastSuccOfSucc {ℓ : ℕ} (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def reducedMLPEvalStatement_to_BBF_Statement (stmt : MLPEvalStatement (L in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • def getFoldingChallenges (i : Fin (ℓ + 1)) (challenges : Fin i → L) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma oracleFoldingConsistencyProp_commit_step_backward (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma neverFails_of_simulateQ_stateful_run'_mk in ArkLib/ToVCVio/Simulation.lean
  • theorem prop_4_23_singleRepetition_proximityCheck_bound in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • lemma OracleStatement.heq_of_fin_eq {i j : Fin (ℓ + 1)} (h : i = j) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • def batchingStepLogic : in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • def finTwoPowSumEquiv (n : ℕ) : Fin (2 ^ n) ⊕ Fin (2 ^ n) ≃ Fin (2 ^ (n + 1)) in ArkLib/Data/Fin/BigOperators.lean
  • def finToBinaryCoeffs (i : Fin r) (idx : Fin (2 ^ (ℓ + R_rate - i.val))) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def fiberwiseDistance (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • theorem splitSum_embedSum_fst {m : ℕ} {n : Fin m → ℕ} (i : Fin m) (j : Fin (n i)) : in ArkLib/Data/Fin/Sigma.lean
  • def foldPrvState (i : Fin ℓ) : Fin (2 + 1) → Type in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma simulateQ_vector_mapM {ι ι' : Type} {spec : OracleSpec ι} {superSpec : OracleSpec ι'} in ArkLib/ToVCVio/Simulation.lean
  • theorem unroll_1_message_reduction_perfectCompleteness_P_to_V in ArkLib/OracleReduction/Completeness.lean
  • def getMidCodewords {i : Fin (ℓ + 1)} (t : L⦃≤ 1⦄[X Fin ℓ]) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • def batchingCoreRbrKnowledgeError in ArkLib/ProofSystem/Binius/FRIBinius/General.lean
  • lemma mkVerifierOStmtOut_inl in ArkLib/OracleReduction/Basic.lean
  • lemma iterated_fold_first (i : Fin r) {midIdx destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma checkSingleRepetition_inner_forIn_probFailure_eq_zero in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • lemma queryBlockSourceSuffix_maps_to_destSuffix in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma batching_doom_escape_probability_bound in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • def masterKStateProp (stmtIdx : Fin (ℓ + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma getFirstOracle_mapOStmtOutRelayStep_eq (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Relay.lean
  • lemma probFailure_forIn_of_invariant in ArkLib/ToVCVio/Simulation.lean
  • def finalSumcheckProverComputeMsg in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • lemma Matrix.mulVec_reindex {m n l : Type*} [Fintype n] [Fintype l] in ArkLib/Data/Fin/BigOperators.lean
  • def queryRbrKnowledgeError_singleRepetition in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • def strictBatchingInputRelationProp (stmt : BatchingStmtIn L ℓ) in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • lemma support_mk {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • def reindexSquareMatrix {n m : Type} (e : n ≃ m) (M : Matrix n n L) : Matrix m m L in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def commitPrvState (i : Fin ℓ) : Fin (1 + 1) → Type in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Commit.lean
  • lemma Statement.of_fin_eq {i j : Fin (ℓ + 1)} (h : i = j) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • def commitKState (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Commit.lean
  • lemma OptionT.simulateQ_ite in ArkLib/ToVCVio/Simulation.lean
  • lemma batching_rbrExtractionFailureEvent_imply_badBatchingEvent in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • def challengeSuffixToFin (k : Fin (ℓ / ϑ)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma fixFirstVariablesOfMQP_eval_eq (v : Fin (ℓ + 1)) {challenges : Fin v → L} in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma support_run_eq_iff {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • lemma witnessStructuralInvariant_MLPEvalWitness_to_BBF_Witness in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • def ReductionLogicStep.IsStronglyComplete in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • def foldOracleVerifier (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • lemma challengeTensorExpansion_bitsOfIndex_is_eq_indicator {n : ℕ} (k : Fin (2 ^ n)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean
  • lemma firstOracleWitnessConsistency_unique in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • lemma oracle_block_k_next_le_i (i : Fin (ℓ + 1)) (j : Fin (toOutCodewordsCount ℓ ϑ i)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma finalSumcheck_honest_message_eq_f_zero in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean
  • instance instInhabitedPspecCommitChallenge {i : Fin ℓ} : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma logical_consistency_checks_passed_of_mem_support_V_run {σ : Type} in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • lemma qMap_ne_zero (i : Fin r) : (qMap 𝔽q β i) ≠ 0 in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma Sdomain_bound {x : ℕ} (h_x : x ≤ ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • theorem iNovelToMonomial_monomialToINovel_inverse (i : Fin r) (h_i : i ≤ ℓ) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • instance instFintypePSpecBatching_AllChallenges : in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • lemma lastBlockOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • instance instInhabitedPSpecFinalSumcheck_AllChallenges : ∀ i, Inhabited ((pSpecFinalSumcheck (L in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • def foldCommitKnowledgeError (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • def FinalSumcheckWit in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/FinalSumcheck.lean
  • lemma OptionT.simulateQ_list_mapM_eq {ι ι' : Type} {spec : OracleSpec ι} in ArkLib/ToVCVio/Simulation.lean
  • lemma fiberwiseDisagreementSet_congr_sourceDomain_index (sourceIdx₁ sourceIdx₂ : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • def challengeTensorExpansionMatrix [CommRing L] (n : ℕ) (r : Fin n → L) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma support_forIn_subset_rel_yield_only in ArkLib/ToVCVio/Simulation.lean
  • lemma sumcheckFoldKnowledgeError_displayMass_le in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma pairUDRClose_of_pairFiberwiseClose (i : Fin r) {destIdx : Fin r} (steps : ℕ) [NeZero steps] in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • def sumcheckConsistencyProp {k : ℕ} (sumcheckTarget : L) (H : L⦃≤ 2⦄[X Fin (k)]) : Prop in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma val_mkFromStmtIdxCastSuccOfSucc_eq_mkFromStmtIdx {ℓ : ℕ} (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma finalSumcheckStep_verifierCheck_passed in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean
  • def oracleFoldingConsistencyProp (i : Fin (ℓ + 1)) (challenges : Fin i → L) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma support_bind {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • lemma sDomain_eq_image_of_upper_span (i : Fin r) (h_i : i < ℓ + R_rate) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • theorem neverFails_simOracle2 {ι : Type u} (oSpec : OracleSpec ι) in ArkLib/OracleReduction/OracleInterface.lean
  • lemma challengeIdx_pSpecFinalSumcheckStep_isEmpty : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma normalizedW_eq_qMap_composition (ℓ R_rate : ℕ) (i : Fin r) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def batchingMismatchPoly (msg0 s_bar : TensorAlgebra K L) : MvPolynomial (Fin κ) L in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • theorem probEvent_runWithLogToRound_ignore_log in ArkLib/OracleReduction/Completeness.lean
  • theorem castInOut_rbrKnowledgeSoundness in ArkLib/OracleReduction/Cast.lean
  • theorem qMap_eval_𝔽q_eq_0 (i : Fin r) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma OptionT.simulateQ_bind in ArkLib/ToVCVio/Simulation.lean
  • def getBBF_Codeword_of_poly (i : Fin r) (h_i : i ≤ ℓ) (P : L⦃< 2 ^ (ℓ - i)⦄[X]) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • def nonLastSingleBlockCommitIdx (bIdx : Fin (ℓ / ϑ - 1)) : Fin ℓ in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma mem_support_map_prod_mk_iff [LawfulMonad m] in ArkLib/ToVCVio/Lemmas.lean
  • def checkSingleRepetition_foldRel in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • def blockBadEventExistsProp in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma getNextOracle_eq_oracleStatement in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma fiberEvaluations_eq_merge_fiberEvaluations_of_one_step_fiber in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma UDRCodeword_eq_of_close in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma intermediateEvaluationPoly_from_inovel_coeffs_eq_self in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • theorem evaluation_poly_split_identity (i : Fin r) (h_i : i < ℓ) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def foldStepFreshDoomPreservationEvent (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • lemma iterated_fold_congr_source_index in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma OptionT.probFailure_mk_forIn_eq_zero_of_body_safe in ArkLib/ToVCVio/Simulation.lean
  • instance instOracleInterfaceMessagePSpecFold : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma butterflyMatrix_det_ne_zero (n : ℕ) (z₀ z₁ : L) (h_ne : z₀ ≠ z₁) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma sBasis_range_eq (i : Fin r) (h_i : i < ℓ + R_rate) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • theorem largeFieldInvocationOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • instance instFintypePSpecQueryChallenge : [(pSpecQuery 𝔽q β γ_repetitions in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma incrementalBadEvent_last_imp_foldingBadEventAtBlock in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma intermediateNovelBasisX_zero_eq_one (i : Fin r) (h_i : i ≤ ℓ) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma iterated_fold_last (i : Fin r) {midIdx destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma probFailure_mk {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • theorem fullRbrKnowledgeError_sum_le_concrete : in ArkLib/ProofSystem/Binius/BinaryBasefold/General.lean
  • def foldKStateProps {i : Fin ℓ} (m : Fin (2 + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • theorem UDRClose_of_fiberwiseClose (i : Fin r) {destIdx : Fin r} (steps : ℕ) [NeZero steps] in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma mem_support_vector_mapM_pure {α β : Type} {n : ℕ} in ArkLib/ToVCVio/Simulation.lean
  • lemma fold_preserves_BBF_Code_membership (i : Fin r) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma not_mem_support_run_none_of_probFailure_eq_zero in ArkLib/ToVCVio/Lemmas.lean
  • theorem forall_eq_bind_pure_iff {α β γ} in ArkLib/OracleReduction/Completeness.lean
  • lemma sum_range_eq_Icc_add_zero {B : ℕ} (f : ℕ → ℕ) (hB : 1 ≤ B) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma iterated_fold_to_const_strict in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • lemma logical_queryFiberPoints_eq_fiberEvaluations in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • instance instFintypeOracleStatementFinLast : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma OptionT.support_run_simulateQ_run'_eq in ArkLib/ToVCVio/Simulation.lean
  • lemma initial_tiled_coeffs_correctness (h_ℓ : ℓ ≤ r) (a : Fin (2 ^ ℓ) → L) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • theorem finalSumcheckOracleVerifier_rbrKnowledgeSoundness {σ : Type} in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/FinalSumcheck.lean
  • def relayKStateProp (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Relay.lean
  • def finalSumcheckKStateProp {m : Fin (1 + 1)} (tr : Transcript m (pSpecFinalSumcheckStep (L in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/FinalSumcheck.lean
  • lemma farness_implies_non_compliance (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean
  • theorem bbf_fullOracleVerifier_knowledgeSoundness : in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • lemma batching_check_correctness in ArkLib/ProofSystem/Binius/RingSwitching/Prelude.lean
  • lemma commitStep_is_logic_complete (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • lemma fold_eval_single_matrix_mul_form (i : Fin r) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma OptionT.simulateQ_array_mapM_eq {ι ι' : Type} {spec : OracleSpec ι} in ArkLib/ToVCVio/Simulation.lean
  • lemma support_bind_simulateQ_run'_eq in ArkLib/ToVCVio/Simulation.lean
  • lemma qMap_total_fiber_congr_source_apply in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma prob_poly_agreement_degree_one {R : Type} [CommRing R] [IsDomain R] [Fintype R] in ArkLib/Data/Probability/Instances.lean
  • lemma getBBF_Codeword_poly_spec (i : Fin r) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma butterflyMatrix0_mul_matrixCTensor_eq_matrixCTensor_mul_butterflyMatrix (n : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma probFailure_OptionT_pure {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • lemma OptionT.simulateQ_failure in ArkLib/ToVCVio/Simulation.lean
  • lemma fold_preTensorCombine_eq_affineLineEvaluation_split in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean
  • theorem monomialToINovel_iNovelToMonomial_inverse (i : Fin r) (h_i : i ≤ ℓ) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def commitStepLogic_embedFn (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • lemma exists_rel_path_of_mem_support_forIn_stateful {ι : Type} {spec : OracleSpec ι} [spec.Fintype] in ArkLib/ToVCVio/Simulation.lean
  • lemma single_point_localized_fold_matrix_form_eq_iterated_fold in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • theorem imp_comm {P Q R : Prop} : (P → Q → R) ↔ (Q → P → R) in ArkLib/ToVCVio/Lemmas.lean
  • lemma Matrix.det_fromBlocks_of_squareSubblocks_commute {n : ℕ} {R : Type*} [CommRing R] in ArkLib/Data/Fin/BigOperators.lean
  • lemma probFailure_simulateQ_simOracle2_eq_zero in ArkLib/ToVCVio/Simulation.lean
  • lemma finTwoPowSumEquiv_apply_right (n : ℕ) (x : Fin (2 ^ n)) : in ArkLib/Data/Fin/BigOperators.lean
  • lemma iterated_fold_congr_steps_index in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma exists_unique_fiberwiseClosestCodeword_within_UDR (i : Fin r) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma getLastOraclePositionIndex_last : getLastOraclePositionIndex ℓ ϑ (Fin.last ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • instance instInhabitedOracleSpecEmpty : (([]ₒ : OracleSpec PEmpty).Inhabited) where in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma OracleComp.probFailure_vector_mapM_eq_zero in ArkLib/ToVCVio/Simulation.lean
  • lemma finalSumcheckStep_is_logic_complete : in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean
  • lemma batchingStep_is_logic_complete : in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • lemma getSumcheckRoundPoly_eval_eq (i : Fin ℓ) (h_poly : ↥L⦃≤ 2⦄[X Fin (ℓ - ↑i.castSucc)]) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma probability_bound_badSumcheckEventProp (h_i h_star : L⦃≤ 2⦄[X]) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness.lean
  • theorem unroll_rbrKnowledgeSoundness in ArkLib/OracleReduction/Completeness.lean
  • lemma qMap_total_fiber_congr_dest in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def batchingProverComputeMsg (stmtIn : BatchingStmtIn L ℓ) (witIn : BatchingWitIn L K ℓ ℓ') : in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • instance instInhabitedPSpecBatching_AllChallenges : in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • lemma foldRelayKnowledgeError_eq (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • theorem unroll_n_message_reduction_perfectCompleteness in ArkLib/OracleReduction/Completeness.lean
  • lemma x_lt_two_pow (x : ℕ) : x < 2 ^ x in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • def badBlockSet in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/BadBlocks.lean
  • instance instMonadLift_right_right {ι₁ ι₂ ι₃ : Type} in ArkLib/ToVCVio/Simulation.lean
  • def logical_stepCondition (oStmt : ∀ j, OracleStatement 𝔽q β (h_ℓ_add_R_rate in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • def incrementalBadEventExistsProp in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma finToBinaryCoeffs_sDomainToFin (i : Fin r) (h_i : i < ℓ + R_rate) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • instance instOracleStatementFintype {i : Fin (ℓ + 1)} : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • def mkFromStmtIdx {ℓ : ℕ} (stmtIdx : Fin (ℓ + 1)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma batching_compute_s0_sub_eq_eval_mismatch in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • lemma batching_target_consistency in ArkLib/ProofSystem/Binius/RingSwitching/Prelude.lean
  • lemma support_pure_bind_pure {α β : Type} (x : α) (f : α → ProbComp β) : in ArkLib/ToVCVio/Lemmas.lean
  • lemma probFailure_run_simulateQ_liftQuery_eq_zero_iff in ArkLib/ToVCVio/Lemmas.lean
  • lemma degree_intermediateEvaluationPoly_lt (i : Fin r) (h_i : i ≤ ℓ) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def splitFinMap_PO2_left {L : Type*} {n : ℕ} (v : Fin (2 ^ (n + 1)) → L) in ArkLib/Data/Fin/BigOperators.lean
  • def sumcheckVerifierCheck (stmtIn : Statement (L in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • theorem rbrKnowledgeSoundness_of_eq_error in ArkLib/OracleReduction/Security/RoundByRound.lean
  • def fiberDiff (i : Fin ℓ) (steps : ℕ) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean
  • lemma probFailure_simulateQ_liftQuery_eq_zero_iff in ArkLib/ToVCVio/Lemmas.lean
  • def foldStepHStarFromWitMid (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • lemma mem_support_simulateQ_liftQuery_some_iff in ArkLib/ToVCVio/Lemmas.lean
  • lemma OracleStatement.oracle_eval_congr in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma iteratedSumcheck_doom_escape_probability_bound (i : Fin ℓ') in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • lemma OracleStatement.idx_eq {i j : Fin (ℓ + 1)} (h : i = j) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma hammingDist_fin1_eq [DecidableEq (Fin 1 → A)] {u v : ι → Fin 1 → A} : in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean
  • theorem coreInteractionOracleRbrKnowledgeError_le : in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean
  • lemma sumcheckStep_is_logic_complete (i : Fin ℓ') : in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • theorem probOutput_uniformOfFintype_eq_Pr in ArkLib/OracleReduction/Completeness.lean
  • theorem multilinear_eval_eq_sum_bool_hypercube [DecidableEq L] [IsDomain L] in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma OptionT.simulateQ_pure in ArkLib/ToVCVio/Simulation.lean
  • theorem intermediateChangeOfBasisMatrix_diag_ne_zero (i : Fin r) (h_i : i ≤ ℓ) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma not_mem_support_none_of_probOutput_none_eq_zero in ArkLib/ToVCVio/Lemmas.lean
  • lemma finalCodeword_zero_eq_t_eval in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean
  • lemma getFirstOracle_snoc_oracle in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • instance instInhabitedPSpecQueryChallenge : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma OptionT.simulateQ_map' {α β : Type u} in ArkLib/ToVCVio/Simulation.lean
  • lemma support_simulateQ_run'_eq in ArkLib/ToVCVio/Simulation.lean
  • lemma preTensorCombine_is_interleavedCodeword_of_codeword (i : Fin ℓ) (steps : ℕ) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean
  • theorem additiveNTT_correctness (h_ℓ : ℓ ≤ r) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma fiberwise_disagreement_isomorphism (i : Fin ℓ) (steps : ℕ) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean
  • def butterflyMatrix (n : ℕ) (z₀ z₁ : L) : Matrix (Fin (2 ^ (n + 1))) (Fin (2 ^ (n + 1))) L in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def rbrExtractionFailureEvent {ι : Type} {oSpec : OracleSpec ι} {StmtIn WitIn WitOut : Type} {n : ℕ} in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • lemma iterated_fold_to_level_ℓ_is_constant in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • theorem iteratedQuotientMap_k_eq_1_is_qMap (i : Fin r) {destIdx : Fin r} in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma qCompositionChain_eq_foldl (i : Fin r) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma support_liftComp_id in ArkLib/ToVCVio/Lemmas.lean
  • lemma oracle_index_add_steps_le_ℓ (i : Fin (ℓ + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma bind_pure_simulateQ_comp in ArkLib/ToVCVio/Simulation.lean
  • def polyToOracleFunc {domainIdx : Fin r} (P : L[X]) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • theorem simulateQ_preserves_safety_mk in ArkLib/ToVCVio/Simulation.lean
  • lemma foldMatrix_det_ne_zero (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma finalSumcheckStep_is_logic_complete : in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • lemma distFromCode_fin1_eq [DecidableEq (Fin 1 → A)] (u : ι → Fin 1 → A) (C : Set (ι → A)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean
  • instance instInhabitedPSpecFinalSumcheckStepMessage : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma fiberwiseDisagreementSet_steps_zero_eq_disagreementSet in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • theorem lemma_4_25_reject_if_suffix_in_disagreement in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean
  • def finalSumcheckStepLogic : in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean
  • lemma degree_intermediateNovelBasisX (i : Fin r) (h_i : i ≤ ℓ) (j : Fin (2 ^ (ℓ - i))) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def queryPhaseProverState : Fin (1 + 1) → Type in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • instance largeFieldInvocationExtractorLens_rbr_knowledge_soundness in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • lemma finalSumcheckStep_verifierCheck_passed in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • def finalSumcheckVerifierStmtOut in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • theorem QueryImpl_append_impl_inr_stateful_run' in ArkLib/ToVCVio/Simulation.lean
  • theorem intermediateNormVpoly_comp_qmap_helper (i : Fin r) (h_i : i < ℓ) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma mem_support_simulateQ_liftQuery_iff in ArkLib/ToVCVio/Lemmas.lean
  • lemma probFailure_forIn_of_relations in ArkLib/ToVCVio/Simulation.lean
  • instance instFintypePSpecFinalSumcheck_AllChallenges : ∀ i, Fintype ((pSpecFinalSumcheck (L in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • def UDRCodeword (i : Fin r) (h_i : i ≤ ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • def BBF_eq_multiplier (r : Fin ℓ → L) : MultilinearPoly L ℓ in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • lemma multilinearWeight_succ {ϑ : ℕ} (r : Fin (ϑ + 1) → F) (i : Fin (2 ^ (ϑ + 1))) : in ArkLib/Data/CodingTheory/Prelims.lean
  • theorem FullTranscript.mk1_eq_snoc {pSpec : ProtocolSpec 1} (msg0 : pSpec.«Type» 0) : in ArkLib/OracleReduction/Basic.lean
  • theorem fullRbrKnowledgeError_sum_le_concrete : in ArkLib/ProofSystem/Binius/FRIBinius/General.lean
  • lemma OptionT.mem_support_StateT_bind_run {σ α β : Type} in ArkLib/ToVCVio/Simulation.lean
  • theorem probEvent_PMF_eq_Pr {α : Type} (pmf : PMF α) (P : α → Prop) [DecidablePred P] : in ArkLib/OracleReduction/Completeness.lean
  • lemma iterated_fold_preserves_BBF_Code_membership (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • def foldWitMid (i : Fin ℓ) : Fin (2 + 1) → Type in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • def preTensorCombine_WordStack (i : Fin ℓ) (steps : ℕ) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean
  • def commitKnowledgeError {i : Fin ℓ} in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Commit.lean
  • lemma prob_poly_agreement_degree_two {R : Type} [CommRing R] [IsDomain R] [Fintype R] in ArkLib/Data/Probability/Instances.lean
  • lemma mem_support_run_map_some_iff [LawfulMonad m] {α β : Type u} in ArkLib/ToVCVio/Lemmas.lean
  • lemma snoc_oracle_impossible {i : Fin ℓ} {j : Fin (toOutCodewordsCount ℓ ϑ i.succ)} in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • def nonLastSingleBlockRbrKnowledgeError (bIdx : Fin (ℓ / ϑ - 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma query_phase_step_preserves_fold in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • lemma checkSingleRepetition_probFailure_eq_zero in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • lemma mem_support_OptionT_bind_run_some_iff [LawfulMonad m] {α β : Type u} in ArkLib/ToVCVio/Lemmas.lean
  • lemma OptionT.liftM_run_getM_bind {α β} {ι₁ ι₂ : Type} {spec₁ : OracleSpec ι₁} in ArkLib/ToVCVio/Simulation.lean
  • lemma UDRClose_iff_within_UDR_radius (i : Fin r) (h_i : i ≤ ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma evaluationPointω_eq_twiddleFactor_of_div_2 (i : Fin r) (h_i : i < ℓ) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • instance instFintypePSpecQuery_AllChallenges : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma NTTStage_correctness (i : Fin (ℓ)) in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def concreteFRIBiniusKnowledgeError : ℝ≥0 in ArkLib/ProofSystem/Binius/FRIBinius/General.lean
  • def blockDiagMatrix (n : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma finTwoPowSumEquiv_apply_left (n : ℕ) (x : Fin (2 ^ n)) : in ArkLib/Data/Fin/BigOperators.lean
  • lemma sum_Icc_one_pred_sub_reindex {B ϑ : ℕ} (f : ℕ → ℕ) (hB : 1 ≤ B) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • theorem run'_bind_lib [Monad m] [LawfulMonad m] (ma : StateT σ m α) (f : α → StateT σ m β) (s : σ) : in ArkLib/ToVCVio/Lemmas.lean
  • lemma OptionT.simulateQ_forIn in ArkLib/ToVCVio/Simulation.lean
  • def incrementalBadEventAtLast in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • theorem queryPhaseLogicStep_isStronglyComplete : in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • def foldVerifierStmtOut (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean
  • def challengeTensorExpansion [CommRing L] (n : ℕ) (r : Fin n → L) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • instance instFintypeOracleSpecEmpty : (([]ₒ : OracleSpec PEmpty).Fintype) where in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • lemma intermediate_poly_P_base (h_ℓ : ℓ ≤ r) (coeffs : Fin (2 ^ ℓ) → L) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma cast_fun_eq_fun_cast_arg.{u, v} {A B : Type u} {C : Type v} (h : A = B) (f : A → C) : in ArkLib/Data/Misc/Basic.lean
  • def castInOut in ArkLib/OracleReduction/Cast.lean
  • instance instFintypePSpecFinalSumcheck_AllChallenges : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma probEvent_pure_iff {α : Type} (p : α → Prop) (x : α) : in ArkLib/ToVCVio/Lemmas.lean
  • def mergeFinMap_PO2_left_right {L : Type*} {n : ℕ} (left : Fin (2 ^ n) → L) in ArkLib/Data/Fin/BigOperators.lean
  • def foldStepWitMidOracleConsistency (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • def getLiftCoeffs (i : Fin ℓ) (steps : ℕ) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean
  • instance instInhabitedPSpecBatchingMessage : [(pSpecBatching κ L K).Message]ₒ.Inhabited in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • lemma Polynomial.toMvPolynomial_totalDegree_le [Nontrivial R] (p : Polynomial R) (i : σ) : in ArkLib/ToMathlib/MvPolynomial/Equiv.lean
  • theorem iteratedQuotientMap_succ_comp in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • lemma goodBlock_implies_UDRClose in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/BadBlocks.lean
  • lemma probFailure_mk_do_bind_bindT_eq_zero_iff {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • def finalSumcheckStepLogic : in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • instance instInhabitedPSpecFinalSumcheckChallenge : in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean
  • lemma prop_4_21_2_case_1_fiberwise_close_incremental in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean
  • lemma Matrix.reindex_mul_reindex {l m n o p q : Type*} [Fintype n] [Fintype p] in ArkLib/Data/Fin/BigOperators.lean
  • def finalSumcheckProverWitOut : Unit in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean
  • lemma OptionT.simulateQ_simOracle2_liftM_query_T2 in ArkLib/ToVCVio/Simulation.lean
  • lemma projectToNextSumcheckPoly_sum_eq (i : Fin ℓ) (Hᵢ : MultiquadraticPoly L (ℓ - i)) (rᵢ : L) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma single_point_localized_fold_matrix_form_congr_source_index in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma OptionT.support_run_eq in ArkLib/ToVCVio/Simulation.lean
  • lemma mem_support_bind_bind_map_generic_iff [LawfulMonad m] in ArkLib/ToVCVio/Lemmas.lean
  • lemma Fin.reindex_reindex {R n m l : Type*} [Fintype n] [Fintype m] [Fintype l] in ArkLib/Data/Fin/BigOperators.lean
  • lemma constantIntermediateEvaluationPoly_eval_eq_const in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • def finalSumcheckProverWitOut (witIn : SumcheckWitness L ℓ' (Fin.last ℓ')) : WitMLP L ℓ' in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean
  • def decomposeChallenge (v : sDomain 𝔽q β h_ℓ_add_R_rate ⟨0, by omega⟩) in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • def batchingProverWitOut (stmtIn : BatchingStmtIn L ℓ) (witIn : BatchingWitIn L K ℓ ℓ') in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • lemma prob_schwartz_zippel_univariate_deg {R : Type} [CommRing R] [IsDomain R] [Fintype R] in ArkLib/Data/Probability/Instances.lean
  • lemma foldBadEventCardSum_le_two_pow : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma goodBlock_point_disagreement_step in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean
  • def relayOracleVerifier_embed (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Relay.lean
  • lemma batchingMismatchPoly_nonzero_of_ne in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • lemma ENNReal.tsum_mul_le_of_le_of_sum_le_one {α : Type*} {f g : α → ℝ≥0∞} {ε : ℝ≥0∞} in ArkLib/OracleReduction/Completeness.lean
  • instance largeFieldInvocationCtxLens_complete : in ArkLib/ProofSystem/Binius/RingSwitching/BBFSmallFieldIOPCS.lean
  • def liftQuery {spec : OracleSpec ι} {α} (q : OracleQuery spec α) : OracleComp spec α in ArkLib/OracleReduction/Completeness.lean
  • lemma iteratedQuotientMap_congr_k in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def fiberEvaluations (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • abbrev BBF_CodeDistance (i : Fin r) : ℕ in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • def BBF_Code (i : Fin r) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma tsum_mul_le_of_le_of_sum_le_one_nnreal {α : Type*} in ArkLib/OracleReduction/Completeness.lean
  • lemma support_challengeQueryImpl_eq {n : ℕ} {pSpec : ProtocolSpec n} in ArkLib/ToVCVio/Simulation.lean
  • lemma exists_fiberwiseClosestCodeword (i : Fin r) {destIdx : Fin r} (steps : ℕ) [NeZero steps] in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • def castOutSimple in ArkLib/OracleReduction/Cast.lean
  • theorem knowledgeSoundness_error_mono in ArkLib/OracleReduction/Security/Basic.lean
  • def queryRbrKnowledgeError in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • lemma addLift_challengeQueryImpl_input_run_eq_liftM_run in ArkLib/ToVCVio/Simulation.lean
  • def lastBlockRbrKnowledgeError (k : (pSpecLastBlock (L in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • abbrev queryBlockSourceSuffix in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean
  • theorem foldOracleVerifier_rbrKnowledgeSoundness (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
  • lemma OptionT.simulateQ_map in ArkLib/ToVCVio/Simulation.lean
  • theorem base_intermediateNovelBasisX (j : Fin (2 ^ ℓ)) : in ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • def getLastOracleDomainIndex (oracleFrontierIdx : Fin (ℓ + 1)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma fold_agreement_of_fiber_agreement (i : Fin ℓ) (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/FoldDistance.lean
  • lemma mem_support_map_some_iff [LawfulMonad m] {α β : Type u} in ArkLib/ToVCVio/Lemmas.lean
  • def fold_eval_fiber₂_vec (i : Fin r) {midIdx destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • lemma OptionT.support_map_run in ArkLib/ToVCVio/Simulation.lean
  • lemma support_run {m : Type u → Type v} [Monad m] [HasEvalSPMF m] in ArkLib/ToVCVio/Lemmas.lean
  • lemma k_mul_ϑ_lt_ℓ {k : Fin (ℓ / ϑ)} : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • lemma prop_4_21_case_2_fiberwise_far (i : Fin ℓ) (steps : ℕ) [NeZero steps] in ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Proposition4_21.lean
  • def nonLastSingleBlockOracleReduction (bIdx : Fin (ℓ / ϑ - 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • lemma probFailure_simulateQ_queryFiberPoints_eq_zero in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • def batchingVerifierStmtOut (stmtIn : BatchingStmtIn L ℓ) in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean
  • def commitStepLogic_embed (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean
  • instance instInhabitedPSpecQueryMessage : in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean
  • lemma constFunc_UDRClose {i : Fin r} (h_i : i ≤ ℓ) (c : L) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • lemma mem_support_OptionT_bind_pure_comp_run_some_iff [LawfulMonad m] {α β : Type u} in ArkLib/ToVCVio/Lemmas.lean
✏️ **Affected:** 48 declaration(s) (line number changed)
  • theorem is_fiber_iff_generates_quotient_point (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L460 to L920
  • theorem sumcheckFoldOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean moved from L547 to L1105
  • def pSpecFinalSumcheck in ArkLib/ProofSystem/Binius/RingSwitching/Spec.lean moved from L43 to L64
  • theorem coreInteractionOracleReduction_perfectCompleteness (hInit : NeverFail init) in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean moved from L625 to L1672
  • lemma qMap_total_fiber_one_level_eq (i : Fin r) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L384 to L840
  • def batchingInputRelation : in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean moved from L198 to L97
  • theorem iteratedSumcheckOracleReduction_perfectCompleteness (i : Fin ℓ') (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean moved from L198 to L307
  • def snoc_oracle {i : Fin ℓ} {destIdx : Fin r} (h_destIdx : destIdx = i.val + 1) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L677 to L1865
  • def take_snoc_oracle (i : Fin ℓ) {destIdx : Fin r} (h_destIdx : destIdx = i.val + 1) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L748 to L1885
  • def fold (i : Fin r) {destIdx : Fin r} (h_destIdx : destIdx = i.val + 1) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L751 to L1355
  • def iterated_fold (i : Fin r) (steps : ℕ) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L789 to L1572
  • theorem fullOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/FRIBinius/General.lean moved from L175 to L191
  • def BinaryBasefoldAbstractOStmtIn : (RingSwitching.AbstractOStmtIn (L in ArkLib/ProofSystem/Binius/FRIBinius/Prelude.lean moved from L51 to L53
  • lemma qMap_total_fiber_repr_coeff (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L343 to L796
  • lemma pointToIterateQuotientIndex_qMap_total_fiber_eq_self (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L525 to L980
  • theorem batchingReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean moved from L314 to L710
  • def sumcheckFoldOracleReduction : OracleReduction []ₒ in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean moved from L501 to L821
  • def queryKStateProp (m : Fin (1 + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean moved from L359 to L2604
  • theorem iterated_fold_eq_matrix_form (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L926 to L2250
  • theorem card_qMap_total_fiber (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L597 to L1097
  • theorem fullOracleVerifier_rbrKnowledgeSoundness : in ArkLib/ProofSystem/Binius/RingSwitching/General.lean moved from L145 to L151
  • def projectToMidSumcheckPoly (t : MultilinearPoly L ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L392 to L672
  • theorem coreInteraction_rbrKnowledgeSoundness : in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean moved from L624 to L1842
  • theorem queryOracleVerifier_rbrKnowledgeSoundness {σ : Type} (init : ProbComp σ) in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean moved from L405 to L2765
  • def foldMatrix (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L776 to L1474
  • lemma batchingCore_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/RingSwitching/General.lean moved from L106 to L110
  • theorem fullOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/RingSwitching/General.lean moved from L119 to L124
  • theorem finalSumcheckOracleVerifier_rbrKnowledgeSoundness {σ : Type} in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean moved from L525 to L1717
  • def finalSumcheckKStateProp {m : Fin (1 + 1)} (tr : Transcript m (pSpecFinalSumcheckStep (L in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean moved from L476 to L1515
  • lemma oracle_block_k_bound (i : Fin (ℓ + 1)) (j : Fin (toOutCodewordsCount ℓ ϑ i)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L802 to L348
  • theorem fullOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/BinaryBasefold/General.lean moved from L111 to L115
  • theorem coreInteractionOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean moved from L645 to L1656
  • def firstOracleWitnessConsistencyProp (t : MultilinearPoly L ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L885 to L1154
  • theorem sumcheckFoldOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean moved from L201 to L250
  • instance sumcheckFoldExtractorLens_rbr_knowledge_soundness in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean moved from L264 to L316
  • abbrev OracleFunction (domainIdx : Fin r) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L234 to L592
  • def projectToNextSumcheckPoly (i : Fin (ℓ)) (Hᵢ : MultiquadraticPoly L (ℓ - i)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L407 to L687
  • theorem coreInteraction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean moved from L592 to L1792
  • def batchingInputRelationProp (stmt : BatchingStmtIn L ℓ) in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean moved from L191 to L85
  • lemma qMap_total_fiber_basis_sum_repr (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L557 to L1010
  • def computeInitialSumcheckPoly (t : MultilinearPoly L ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L376 to L655
  • def batchingRBRKnowledgeError : ℝ≥0 in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean moved from L227 to L420
  • lemma take_snoc_oracle_eq_oStmtIn (i : Fin ℓ) {destIdx : Fin r} (h_destIdx : destIdx = i.val + 1) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L761 to L1899
  • def localized_fold_matrix_form (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L896 to L2121
  • def getFirstOracle {oracleFrontierIdx : Fin (ℓ + 1)} in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L771 to L1913
  • def decompose_tensor_algebra_columns {σ : Type*} (β : Basis σ K L) (s_hat : L ⊗[K] L) : σ → L in ArkLib/ProofSystem/Binius/RingSwitching/Prelude.lean moved from L97 to L100
  • def sumcheckFoldKnowledgeError (j : (pSpecSumcheckFold 𝔽q β (ϑ in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean moved from L562 to L1552
  • def pointToIterateQuotientIndex (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L367 to L822

sorry Tracking

✅ **Removed:** 38 `sorry`(s)
  • lemma iterated_fold_transitivity in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean (L843)
  • theorem relayOracleReduction_perfectCompleteness (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (L707)
  • theorem sumcheckFoldOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean (L558)
  • theorem iteratedSumcheckOracleReduction_perfectCompleteness (i : Fin ℓ') (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean (L209)
  • def foldKnowledgeStateFunction (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (L368)
  • def foldKnowledgeStateFunction (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (L369)
  • theorem foldOracleReduction_perfectCompleteness (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (L231)
  • theorem iteratedSumcheckOracleVerifier_rbrKnowledgeSoundness (i : Fin ℓ') : in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean (L339)
  • lemma single_point_localized_fold_matrix_form_eq_iterated_fold in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean (L937)
  • def relayKnowledgeStateFunction (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (L759)
  • def relayKnowledgeStateFunction (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (L761)
  • theorem batchingOracleVerifier_rbrKnowledgeSoundness : in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean (L343)
  • def commitKState (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (L596)
  • def commitKState (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (L598)
  • theorem finalSumcheckOracleReduction_perfectCompleteness {σ : Type} in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (L923)
  • theorem foldOracleVerifier_rbrKnowledgeSoundness (i : Fin ℓ) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (L384)
  • theorem batchingReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/RingSwitching/BatchingPhase.lean (L323)
  • def queryKStateProp (m : Fin (1 + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean (L402)
  • theorem fullOracleVerifier_rbrKnowledgeSoundness : in ArkLib/ProofSystem/Binius/RingSwitching/General.lean (L180)
  • theorem fullOracleVerifier_rbrKnowledgeSoundness : in ArkLib/ProofSystem/Binius/RingSwitching/General.lean (L184)
  • lemma nonDoomedFoldingProp_relay_preserved (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean (L944)
  • theorem queryOracleVerifier_rbrKnowledgeSoundness {σ : Type} (init : ProbComp σ) in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean (L416)
  • theorem finalSumcheckOracleReduction_perfectCompleteness {σ : Type} in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean (L450)
  • def foldMatrix (i : Fin r) (steps : Fin (ℓ + 1)) (h_i_add_steps : i.val + steps < ℓ + 𝓡) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean (L786)
  • theorem commitOracleReduction_perfectCompleteness (i : Fin ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (L529)
  • theorem sumcheckFoldOracleVerifier_rbrKnowledgeSoundness : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean (L580)
  • theorem finalSumcheckOracleVerifier_rbrKnowledgeSoundness {σ : Type} in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean (L535)
  • theorem queryOracleProof_perfectCompleteness {σ : Type} in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean (L341)
  • def finalSumcheckKStateProp {m : Fin (1 + 1)} (tr : Transcript m (pSpecFinalSumcheckStep (L in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean (L520)
  • def finalSumcheckKStateProp {m : Fin (1 + 1)} (tr : Transcript m (pSpecFinalSumcheckStep (L in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean (L522)
  • theorem OracleReduction.id_runWithLog (stmt : StmtIn) (oStmt : ∀ i, OStmtIn i) (wit : WitIn) : in ArkLib/OracleReduction/Execution.lean (L380)
  • lemma oracleWitnessConsistency_relay_preserved in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean (L973)
  • theorem finalSumcheckOracleReduction_perfectCompleteness {σ : Type} in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean (L476)
  • def finalSumcheckKStateProp {m : Fin (1 + 1)} (tr : Transcript m (pSpecFinalSumcheckStep (L in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (L1016)
  • def finalSumcheckKStateProp {m : Fin (1 + 1)} (tr : Transcript m (pSpecFinalSumcheckStep (L in ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (L1018)
  • def sumcheckFoldKnowledgeError in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean (L567)
  • def iteratedSumcheckKnowledgeStateFunction (i : Fin ℓ') : in ArkLib/ProofSystem/Binius/RingSwitching/SumcheckPhase.lean (L327)
  • theorem finalSumcheckOracleVerifier_rbrKnowledgeSoundness [Fintype L] {σ : Type} in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean (L597)

🎨 **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 & Proofs

Rule: "Theorems and Proofs: snake_case (e.g., add_comm, list_reverse_id)."
There are approximately 60 violations of this rule where CamelCase or mixed-case identifiers are used for lemmas and theorems.

  • AdditiveNTT.lean Line 24: lemma multilinearWeight_succ should be multilinear_weight_succ.
  • AdditiveNTT.lean Line 83: lemma natDegree_qMap should be nat_degree_q_map.
  • AdditiveNTT.lean Line 756: theorem intermediateNormVpoly_comp_qmap should be intermediate_norm_v_poly_comp_q_map.

Naming Conventions: Functions & Terms

Rule: "Functions and Terms: lowerCamelCase (e.g., binarySearch, isPrime)."

  • AdditiveNTT.lean Line 60: def sDomain_cast should be sDomainCast.
  • AdditiveNTT.lean Line 442: def sDomain_basis should be sDomainBasis.
  • AdditiveNTT.lean Line 1072: def sDomain.lift should be sDomain.lift.

Naming Conventions: Acronyms

Rule: "Acronyms: Treat as words (e.g., HtmlParser not HTMLParser)."

  • AdditiveNTT.lean Line 1708: def NTTStage should be nttStage.
  • BigOperators.lean Line 60: PO2 in splitFinMap_PO2_left should be Po2.
  • Relations.lean Line 589: MLP in extractMLP should be Mlp.

Symbol Naming Dictionary

Rule: "0 -> zero, 1 -> one."

  • AdditiveNTT.lean Line 120: qMap_eval_𝔽q_eq_0 should be q_map_eval_fq_eq_zero.
  • AdditiveNTT.lean Line 518: get_sDomain_first_basis_eq_1 should be get_s_domain_first_basis_eq_one.
  • AdditiveNTT.lean Line 1845: novel_poly_of_1_leading_suffix should be novel_poly_of_one_leading_suffix.

Syntax and Formatting: Line Length

Rule: "Keep lines under 100 characters."
Multiple lines exceed the 100-character limit.

  • AdditiveNTT.lean Line 27: (105 characters)
  • AdditiveNTT.lean Line 131: (104 characters)
  • AdditiveNTT.lean Line 2168: (102 characters)

Syntax and Formatting: Empty Lines

Rule: "Avoid empty lines inside definitions or proofs."

  • AdditiveNTT.lean Line 1611: Empty line inside evaluationPointω_eq_twiddleFactor_of_div_2 proof.
  • AdditiveNTT.lean Line 1660: Empty line inside eval_point_ω_eq_next_twiddleFactor_comp_qmap proof.
  • AdditiveNTT.lean Line 1818: Empty line inside evenRefinement_eq_novel_poly_of_0_leading_suffix proof.

Syntax and Formatting: Tactic Mode

Rule: "Place by at the end of the line preceding the tactic block. Indent the tactic block."

  • AdditiveNTT.lean Line 244-250: The by for theorem qMap_maps_sDomain is placed on a new line (Line 250) rather than at the end of Line 249.

Syntax and Formatting: Binders & Operators

Rule: "Use a space after binders... Put spaces on both sides of : , := , and infix operators."

  • AdditiveNTT.lean Line 1717: 2^i.val missing spaces around ^.
  • AdditiveNTT.lean Line 55: (n + 1) and 2 ^ (n + 1) are correct, but Line 19: 2 ^ ϑ is correct, yet Line 31: ℓ + R_rate uses spaces while Line 545: 2^(ℓ + R_rate - i.val) lacks them.

Syntax and Formatting: Functions

Rule: "Prefer fun x ↦ ... over λ x, ..." (And by extension, prefer over => for anonymous functions in the project style).

  • AdditiveNTT.lean Line 1303: toFun := fun p => fun k => ... should use .
  • AdditiveNTT.lean Line 1785: fun ⟨j, hj⟩ => by should use if not immediately entering a tactic block.

Documentation Standards

Rule: "Every definition and major theorem should have a docstring."
Approximately 15 major declarations are missing docstrings.

  • AdditiveNTT.lean Line 53: sDomain is missing a docstring.
  • AdditiveNTT.lean Line 77: qMap is missing a docstring.
  • AdditiveNTT.lean Line 1104: intermediateNovelBasisX is missing a docstring.

Variable Conventions

Rule: "m, n, k : Natural numbers; u, v, w : Universes."

  • AdditiveNTT.lean Line 31: and R_rate are used as natural number variables; the guide specifies m, n, k.
  • AdditiveNTT.lean Line 19: ϑ is used as a natural number variable.

📄 **Per-File Summaries**
  • ArkLib.lean: This update expands the library's core exports by adding numerous modules related to the Binary Basefold protocol, specifically focusing on its soundness proofs, execution steps, and underlying relations. It also incorporates new components for Additive NTT field theory, oracle reduction completeness, and simulation utilities.
  • ArkLib/Data/CodingTheory/DivergenceOfSets.lean: This PR refactors proofs in the Pr_uniform_equiv and concentration_bounds theorems to be more explicit and maintainable. It replaces high-level tactic calls like simpa and simp with structured calc blocks and direct applications of congr_arg, without introducing new theorems or sorry placeholders.
  • ArkLib/Data/CodingTheory/Prelims.lean: This update introduces several new theorems—multilinearWeight_succ, multilinearWeight_succ_lower_half, and multilinearWeight_succ_upper_half—that provide a recursive decomposition for multilinear weights based on index bit representation. These lemmas facilitate reasoning about tensor combinations by splitting weights into lower and upper halves of the index range. No sorry or admit placeholders are introduced.
  • ArkLib/Data/CodingTheory/ProximityGap/BCIKS20/AffineSpaces.lean: This PR refactors and simplifies the proof of exists_basepoint_with_large_line_prob_aux by replacing complex simpa calls with more direct simp and exact tactics. No new theorems or definitions are introduced, and the changes do not add any sorry or admit placeholders.
  • ArkLib/Data/CodingTheory/ReedSolomon.lean: This change introduces a Nontrivial instance for ReedSolomon.code, proving that the code contains non-zero elements when the evaluation set is nonempty and the degree bound is positive. The proof explicitly constructs a non-zero codeword using the constant code of one and contains no sorry placeholders.
  • ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean: This file implements the FRI-Binius variant of the Additive NTT algorithm, providing formal definitions for intermediate evaluation domains, quotient maps, and subspace vanishing polynomials. It introduces the additiveNTT encoding algorithm and its core butterfly stage, accompanied by a complete formal proof of correctness (additiveNTT_correctness). No sorry or admit placeholders are present in the implementation.
  • ArkLib/Data/Fin/BigOperators.lean: This file introduces new definitions and theorems for reindexing, splitting, and merging vectors and matrices, headlined by a general proof for the determinant of a $2 \times 2$ block matrix with commuting sub-blocks.
  • ArkLib/Data/Fin/Sigma.lean: This update completes the proofs for embedSum_splitSum, splitSum_embedSum, and dflatten_splitSum by removing existing sorry placeholders. It also introduces the new theorem splitSum_embedSum_fst to characterize the index component of a split sum.
  • ArkLib/Data/Misc/Basic.lean: This update introduces new lemmas concerning function η-expansion and the interaction between type casting and function domains. Specifically, the added theorems facilitate reasoning about function equality and simplify casted functions into functions with casted arguments, with no sorry placeholders introduced.
  • ArkLib/Data/Probability/Instances.lean: This file introduces several new probability theorems and lemmas, including the union bound (Pr_or_le), product rules for independent repetitions (prob_pow_of_forall_finFun), and specialized Schwartz-Zippel bounds for univariate polynomials of degree one and two. The changes also include minor proof refactorings and new aliases for existing lemmas. No sorry or admit placeholders were introduced.
  • ArkLib/OracleReduction/Basic.lean: This update introduces the mkVerifierOStmtOut definition and supporting lemmas to modularize the routing of output oracle statements within verifiers. It also adds utility functions and theorems for constructing and reasoning about transcripts in single-round protocols, with no sorry placeholders introduced.
  • ArkLib/OracleReduction/Cast.lean: This file introduces generalized casting definitions for OracleReduction and OracleVerifier and proves theorems showing that security properties, such as completeness and round-by-round knowledge soundness, are preserved under these type transformations.
  • ArkLib/OracleReduction/Completeness.lean: This file introduces a library of reusable theorems and utility lemmas for proving the perfect completeness and round-by-round knowledge soundness of interactive oracle reductions. It provides a generic "unrolling" framework for $n$-message protocols alongside specialized versions for common interaction patterns (0, 1, and 2-message exchanges) and automation for simplifying probabilistic soundness goals. All proofs are complete, and no sorry or admit placeholders are introduced.
  • ArkLib/OracleReduction/Execution.lean: This change refactors the OracleVerifier.run definition to use a helper function and successfully replaces multiple sorry placeholders with complete proofs. These proofs establish key equivalences between oracle-based reductions and their non-oracle counterparts, as well as the correctness of identity reductions.
  • ArkLib/OracleReduction/OracleInterface.lean: This PR introduces the theorems neverFails_simOracle and neverFails_simOracle2 to prove that simulation oracles based on deterministic transcript lookups are guaranteed to never fail.
  • ArkLib/OracleReduction/Security/RoundByRound.lean: This update introduces rbrKnowledgeSoundness_of_eq_error theorems for both Verifier and OracleVerifier to facilitate transferring round-by-round knowledge soundness properties between pointwise equal error functions. The file also contains an existing sorry placeholder in the incomplete proof for rbrKnowledgeSoundnessOneShot_implies_rbrKnowledgeSoundness.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean: This change refactors the Binary Basefold protocol's formalization by introducing more precise indexing logic, including OracleFrontierIndex and mappings between oracle positions and domain indices. It introduces several new definitions and theorems that rigorously link successful polynomial extraction (extractMLP) to unique decoding radius (UDR) closeness and protocol compliance. Additionally, it refactors sumcheck polynomial projection properties and removes several older, incomplete definitions, effectively eliminating previous sorry placeholders in favor of more granular proofs.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean: This file defines the Reed-Solomon codes used in the Binary Basefold protocol and establishes their core properties, such as distance calculations and criteria for unique decoding radius (UDR) closeness. It introduces theorems proving that the protocol's folding operations preserve code membership and that "fiberwise" closeness implies Hamming closeness to the code. The implementation also provides a computational method to extract unique codewords using the Berlekamp-Welch decoder and contains no sorry or admit placeholders.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean: This file defines protocol-level proximity, compliance, and "bad-event" predicates for the Binary Basefold protocol, which are essential for its soundness proof. It introduces several new definitions, including isCompliant and foldingBadEvent, and provides proofs for properties like fold-error containment and the consistency of incremental bad events. The file contains no sorry or admit placeholders.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean: This update refactors the Binary Basefold prelude to introduce recursive matrix-based folding structures, specifically the butterflyMatrix and foldMatrix, and generalized iterated_fold operations. It introduces new theorems and proofs connecting point-wise folding to matrix-vector multiplication (Lemma 4.9) and polynomial evaluation structure (Lemma 4.14). Note that the theorem iterated_fold_transitivity currently contains a sorry placeholder.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean: This refactor migrates the query phase to the OracleAwareReductionLogicStep framework, replacing standalone helper definitions with a structured reduction logic. It introduces several new definitions and theorems to formally establish the strong completeness and round-by-round knowledge soundness of the protocol, successfully removing previous placeholders.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean: This file formalizes the interactive reduction logic for the individual steps of the Binary Basefold protocol, specifically covering the folding round, the commitment round, and the final sum-check. It introduces new structures for modularly defining protocol steps—ReductionLogicStep and OracleAwareReductionLogicStep—and provides complete proofs for the strong completeness of each step without the use of sorry placeholders.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean: This file introduces new formal definitions and theorems defining the protocol relations and security predicates for the Binary Basefold proof system. It establishes core invariants for folding consistency, sumcheck targets, and "bad-event" logic used in the security analysis of the protocol. The changes include several lemmas proving the preservation of these relations across protocol steps, and the file contains no sorry placeholders.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness.lean: This new file serves as the primary entry point for the Binary Basefold soundness proof, re-exporting various submodules that establish the folding and distance lemmas required for the protocol. It introduces the probability_bound_badSumcheckEventProp lemma, which provides a Schwartz-Zippel-based probability bound for the event where two distinct degree-≤2 polynomials agree at a uniform verifier challenge. The file contains no sorry placeholders.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/BadBlocks.lean: This file introduces definitions and theorems for "bad block" bookkeeping used in the terminal query-phase soundness analysis of the Binary Basefold protocol. It defines predicates to identify blocks failing folding-compliance, provides lemmas to localize these failures via the highest bad block, and includes a probability helper for uniform suffix challenges.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/FoldDistance.lean: This new file establishes lemmas and theorems for distance and disagreement transfer from fiber views to folded codewords, which are essential for the soundness analysis of the Binius protocol. It introduces several helper lemmas relating fiber agreement to fold agreement and culminates in a formalization of Lemma 4.25 from [DP24], providing folded-distance lower bounds used in bad-block analysis. All proofs in this file are complete with no sorry or admit placeholders.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean: This file introduces new definitions and theorems to formalize the incremental bad-event analysis for the Binary Basefold soundness proof, specifically establishing Proposition 4.21.2. It implements an even/odd splitting technique to bridge Binius folding with affine line proximity gaps and provides a complete formalization of the incremental step for both fiberwise close and far cases. The file contains no sorry or admit placeholders.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean: This file introduces the lifting and tensor-expansion infrastructure for the Binary Basefold soundness proof, providing definitions for preTensorCombine and lift_interleavedCodeword. It formalizes key results such as the fiberwise disagreement isomorphism and the interleaved-distance lower bound (Lemma 4.22). All new theorems and proofs are complete, containing no sorry or admit placeholders.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Proposition4_21.lean: This file formalizes Proposition 4.21 of the Binius protocol, providing a probability bound for the "bad folding event" during a protocol step. It introduces new lemmas for the fiberwise-close case using the Schwartz-Zippel lemma and the fiberwise-far case using tensor product proximity gap results, culminating in the complete proof of the proposition. No sorry or admit placeholders are present in the code.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean: This file introduces new definitions and lemmas to establish the foundational infrastructure for the query phase soundness proof of the Binary Basefold protocol. It provides both monadic and logical implementations of the proximity checking logic alongside alignment lemmas for challenge decomposition and oracle folding consistency. No sorry or admit placeholders are included.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean: This new file formalizes the Query Phase soundness for the Binary Basefold protocol, introducing key theorems that establish probability bounds for the proximity check. It specifically implements Lemma 4.26 and Proposition 4.24 from Diamond and Posen (2024), proving that disagreement on terminal suffixes leads to query rejection and providing the final soundness error bound for a single repetition. The proofs in this file are complete and contain no sorry or admit placeholders.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean: This module expands the Binary Basefold protocol specification by adding a comprehensive set of OracleInterface, SampleableType, Fintype, and Inhabited instances for various protocol messages and challenges. It refactors several protocol-level definitions using the @[reducible] attribute and introduces a new lemma for oracle statement equality, without adding any sorry placeholders.
  • ArkLib/OracleReduction/Security/Basic.lean: This Lean file introduces two new theorems, soundness_error_mono and knowledgeSoundness_error_mono, which establish that the soundness and knowledge soundness properties of a verifier are monotonic with respect to their error bounds. These proofs ensure that a verifier satisfying a specific error bound also satisfies any larger bound, and no sorry or admit placeholders were added.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/General.lean: This update establishes a concrete scalar knowledge soundness bound for the Binary Basefold protocol, aligning the formalization with the error terms presented in the DP24 paper. It introduces new theorems, including fullOracleVerifier_knowledgeSoundness, and refines the perfect completeness proof by employing stricter relations and requiring non-failing initializations. No sorry or admit placeholders were added.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean: This refactor reorganizes the Binary Basefold protocol steps by moving their monolithic implementation into a new modular subdirectory structure. The logic for the Fold, Commit, Relay, and Final Sumcheck steps has been relocated to separate files, simplifying this file into a central collection of imports.
  • ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean: This update formally completes the Binary Basefold core interaction phase by sequentially composing individual protocol steps into blocks and proving their aggregate security properties. It introduces new definitions and lemmas for block-level verifiers and reductions, replaces previous sorry placeholders with full proofs for perfect completeness and knowledge soundness, and derives a rigorous bound for the aggregate knowledge error.

Last updated: 2026-04-06 12:53 UTC.

@chung-thai-nguyen
chung-thai-nguyen force-pushed the completeness-of-binius branch 2 times, most recently from 9edd9d8 to 6de2e83 Compare March 4, 2026 15:57
@chung-thai-nguyen
chung-thai-nguyen marked this pull request as ready for review March 6, 2026 12:39
@alexanderlhicks

Copy link
Copy Markdown
Collaborator

/review

External:
https://eprint.iacr.org/2024/504.pdf
https://eprint.iacr.org/2023/1784.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

github-actions Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

🤖 AI Review

Reviewed at commit a447fd8fd0a2.

Caution

This review did not complete normally. One or more AI calls failed for a spend, quota, or authentication reason, or the per-run budget was exhausted. The results below are PARTIAL and must not be read as a clean review — see the Actions log for details.

Verdict (deterministic): Changes Requested

Basis:

  • The automated review did not complete (see the notice above); treat this PR as NOT reviewed.

📚 References & context used

Knowledge base / specification (5):

  • docs/kb/papers/ACFY24.md
  • docs/kb/papers/AHIV22.md
  • docs/kb/papers/BCIKS20.md
  • docs/kb/papers/BCS16.md
  • docs/kb/papers/DP24.md

Repository context provided (50 file(s) from the dependency graph; large sets may be trimmed to fit the model's budget):

  • ArkLib.lean
  • ArkLib/Data/CodingTheory/DivergenceOfSets.lean
  • ArkLib/Data/CodingTheory/Prelims.lean
  • ArkLib/Data/CodingTheory/ProximityGap/BCIKS20/AffineSpaces.lean
  • ArkLib/Data/CodingTheory/ReedSolomon.lean
  • ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • ArkLib/Data/Fin/BigOperators.lean
  • ArkLib/Data/Fin/Sigma.lean
  • ArkLib/Data/Misc/Basic.lean
  • ArkLib/Data/MvPolynomial/RestrictDegree.lean
  • ArkLib/Data/Probability/Instances.lean
  • ArkLib/OracleReduction/Basic.lean
  • ArkLib/OracleReduction/Cast.lean
  • ArkLib/OracleReduction/Completeness.lean
  • ArkLib/OracleReduction/Execution.lean
  • ArkLib/OracleReduction/OracleInterface.lean
  • ArkLib/OracleReduction/Security/Basic.lean
  • ArkLib/OracleReduction/Security/RoundByRound.lean
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean
  • ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • ArkLib/ProofSystem/Binius/BinaryBasefold/General.lean
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • …and 25 more

@chung-thai-nguyen
chung-thai-nguyen marked this pull request as draft March 22, 2026 08:31
@chung-thai-nguyen chung-thai-nguyen changed the title feat: completeness of Binary Basefold & ring-switching feat: completeness and rbrKnowledge soundness of FRI-Binius Mar 22, 2026
@chung-thai-nguyen chung-thai-nguyen changed the title feat: completeness and rbrKnowledge soundness of FRI-Binius feat: completeness and rbrKnowledgeSoundness of FRI-Binius Mar 22, 2026
@chung-thai-nguyen chung-thai-nguyen changed the title feat: completeness and rbrKnowledgeSoundness of FRI-Binius feat: completeness and rbrKnowledgeSoundness of FRI-Binius protocols Mar 22, 2026
@chung-thai-nguyen
chung-thai-nguyen marked this pull request as ready for review March 22, 2026 17:03
@github-actions

github-actions Bot commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

Build Timing Report

  • Commit: a447fd8
  • Message: feat: completeness and rbrKnowledgeSoundness of FRI-Binius protocols
  • Ref: completeness-of-binius
  • Comparison baseline: d61905b from current base of main.
  • Measured on ubuntu-latest with /usr/bin/time -p.
  • Commands: clean build rm -rf .lake/build && lake build; warm rebuild lake build; validation wrapper ./scripts/validate.sh.
Measurement Baseline (s) Current (s) Delta (s) Status
Clean build 783.51 913.97 +130.46 ok
Warm rebuild 2.21 2.27 +0.06 ok
Validation wrapper 2.37 2.37 +0.00 ok

Incremental Rebuild Signal

  • Warm rebuild saved 911.70s vs clean (402.63x faster).

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 Files

Showing 20 slowest current targets, with comparison against the selected baseline when available.

Current (s) Baseline (s) Delta (s) Path
107.00 81.00 +26.00 ArkLib/ProofSystem/Stir/Combine.lean
66.00 67.00 -1.00 ArkLib/Data/CodingTheory/GuruswamiSudan/Basic.lean
59.00 57.00 +2.00 ArkLib/Data/CodingTheory/JohnsonBound/Lemmas.lean
56.00 54.00 +2.00 ArkLib/Data/CodingTheory/ProximityGap/BCIKS20/AffineLines/BWMatrix.lean
55.00 61.00 -6.00 ArkLib/Data/CodingTheory/ProximityGap/AHIV22.lean
55.00 60.00 -5.00 ArkLib/Data/CodingTheory/ProximityGap/BCIKS20/AffineSpaces.lean
55.00 65.00 -10.00 ArkLib/Data/CodingTheory/ProximityGap/DG25/MainResults.lean
50.00 55.00 -5.00 ArkLib/Data/CodingTheory/ProximityGap/Folding.lean
49.00 - - ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
47.00 8.20 +38.80 ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
40.00 10.00 +30.00 ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
39.00 51.00 -12.00 ArkLib/OracleReduction/LiftContext/Reduction.lean
35.00 42.00 -7.00 ArkLib/Data/CodingTheory/BerlekampWelch/Condition.lean
33.00 29.00 +4.00 ArkLib/Data/Polynomial/FoldingPolynomial.lean
32.00 26.00 +6.00 ArkLib/ProofSystem/Sumcheck/Spec/SingleRound.lean
32.00 42.00 -10.00 ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
32.00 19.00 +13.00 ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean
31.00 - - ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean
29.00 40.00 -11.00 ArkLib/Commitments/Functional/KZG/FunctionBinding/EvaluationBindingConflict.lean
29.00 27.00 +2.00 ArkLib/Data/CodingTheory/DivergenceOfSets.lean

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

alexanderlhicks and others added 10 commits June 1, 2026 00:32
…ed sorry)

The oracle-reduction RBR-knowledge-soundness theorem appeared closed but its
`oracleKnowledgeStateFunction.toFun_full` carried a `sorry`, so the theorem
transitively depended on `sorryAx`. Port the complete non-oracle
`knowledgeStateFunction.toFun_full` proof to the oracle case: extract `relOut`
membership from the positive-probability hypothesis (the zero-round oracle
verifier deterministically returns `(mapStmt stmtIn, mapOStmt … oStmtIn)`), then
apply the unchanged `hRel`. The theorem statement, `hRel`, `relIn`, `relOut`,
`mapWitInv`, and `toFun` are unchanged.

Verified: `#print axioms` on both `oracleKnowledgeStateFunction` and
`oracleVerifier_rbrKnowledgeSoundness` → [propext, Classical.choice, Quot.sound]
(no sorryAx); full `lake build` green (4104 jobs).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Integrates the generic ring-switching implementation up to ab5874a -- the
commit immediately before RingSwitchingProfile (708c0c3) -- deliberately
excluding the RingSwitchingProfile packing-layer abstraction and its
genericization, which are not wanted on this branch. (On main these landed
together in PR #516, so ab5874a is the only snapshot with the ring-switching
implementation minus RingSwitchingProfile.)

Resolves all merge conflicts and repairs the VCVio dependency-bump breakage
across the Binius proof system. The entire Binius/, RingSwitching/, and
ToVCVio/ source now builds with 0 errors and is fully sorry-free -- verified
queryOracleVerifier_rbrKnowledgeSoundness depends only on
[propext, Classical.choice, Quot.sound] (no sorryAx). Key addition:
the support_liftM_optionT bridging lemma in ArkLib/ToVCVio/Lemmas.lean.

RingSwitchingProfile (708c0c3) is NOT in this branch's history.
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🤖 PR Summary

ℹ️ Some sections were omitted to fit GitHub's comment size limit.

ℹ️ This PR modifies 1 file(s) under ArkLib/ToMathlib/ — consider whether a corresponding upstream PR is needed.

sorry delta: -48 (48 removed) — net proof progress

Mathematical Formalization

  • Additive NTT: New AdditiveNTT.lean (3090 lines) defines the core algebraic infrastructure for the additive Number Theoretic Transform over binary tower fields, including intermediate evaluation domains sDomain, quotient maps qMap, normalized vanishing polynomials intermediateNormVpoly, and their properties (Theorems 4.3, Lemma 4.2, Corollary 4.4, Corollary 4.5).
  • Coding Theory: New ReedSolomon.lean adds Nontrivial instance; DivergenceOfSets.lean (no summary; likely proof updates); Prelims.lean adds multilinear weight lemmas.
  • Binary Basefold Codes: New Code.lean defines BBF_Code (Reed-Solomon codes with domain sDomain and degree 2^{ℓ-i}), distance notions (UDRClose, pair_UDRClose, fiberwiseClose), and unique decoding via Berlekamp–Welch (extractUDRCodeword). Lemmas fold_preserves_BBF_Code_membership and iterated_fold_preserves_BBF_Code_membership connect folding to code membership.
  • Compliance: New Compliance.lean defines isCompliant (Definition 4.18), fold_error_containment, and foldingBadEvent (Definition 4.20) alongside incremental variants.
  • Probability & Schwartz–Zippel: Instances.lean adds union bound (Pr_or_le), uniform random function lemmas (prob_pow_of_forall_finFun), and three Schwartz–Zippel bounds (univariate, degree‑1 and degree‑2 agreement).
  • Block matrices: New Fin/BigOperators.lean provides Fin indexing helpers, block‑matrix constructions (Matrix.from4Blocks), and determinant formulas for block‑2×2 matrices with commuting blocks.
  • Miscellaneous: Eta‑expansion lemmas in Misc/Basic.lean; fixFirstVariablesOfMQP_zero_eq in MvPolynomial/RestrictDegree.lean; Polynomial.toMvPolynomial lemmas in ToMathlib/MvPolynomial/Equiv.lean.

Proof Completion (sorries removed)

All previously existing sorry placeholders in the codebase have been eliminated in this PR. Specific completions include:

  • dflatten_splitSum in Fin/Sigma.lean (proof finished).
  • proj_complete, lift_complete, proj_knowledgeSound, lift_knowledgeSound in FRIBinius/CoreInteractionPhase.lean (formerly sorry-filled, now fully proved).
  • The query phase verifier in QueryPhase.lean (previously had a sorry in verify block, replaced with logic‑step delegation).
  • Several completeness and soundness proofs in FRIBinius/General.lean and RingSwitching/General.lean (the two sorry placeholders in fullOracleVerifier_rbrKnowledgeSoundness are removed).

No new sorry or admit placeholders are introduced anywhere in the diff.

Protocols / Soundness

  • Binary Basefold:
    • Relations.lean defines masterKStateProp, roundRelation, strictRoundRelation, foldStepRelOut, and bad‑event predicates (foldingBadEventAtBlock, incrementalBadEventExistsProp).
    • Soundness.lean re‑exports submodules: QueryPhasePrelims, Lift, Proposition4_21, Incremental, FoldDistance, BadBlocks, QueryPhaseSoundness. The core probability bound probability_bound_badSumcheckEventProp uses Schwartz–Zippel degree‑2.
    • Soundness/Proposition4_21.lean formalizes Proposition 4.21 bounding the bad folding event, combining a union bound (case 1) and interleaved‑distance bridge (case 2).
    • Soundness/Lift.lean builds the tensor‑expansion lift infrastructure, including preTensorCombine_WordStack, getLiftPoly, folded_lifted_IC_eq_IC_row_polyToOracleFunc, and Lemma 4.22 (lemma_4_21_interleaved_word_UDR_far).
    • Soundness/FoldDistance.lean provides Lemma 4.25 (lemma_4_24_dist_folded_ge_of_last_noncompliant).
    • Soundness/Incremental.lean contains Proposition 4.21.2 case 1, even/odd split lemmas, and bridge lemmas connecting folding to affine‑line evaluation.
    • Soundness/BadBlocks.lean defines badBlockProp, highestBadBlock, and goodBlock_implies_UDRClose.
    • Soundness/QueryPhaseSoundness.lean proves Lemma 4.26 (lemma_4_25_reject_if_suffix_in_disagreement), linking query‑phase rejection to point‑wise disagreement.
    • Completeness.lean (at OracleReduction/) provides reusable unrolling tools: unroll_n_message_reduction_perfectCompleteness, unroll_rbrKnowledgeSoundness, soundness_unroll_runToRound.
    • ReductionLogic.lean introduces ReductionLogicStep and OracleAwareReductionLogicStep structures for fold, commit, and final sumcheck steps, with completeness lemmas (foldStep_is_logic_complete, commitStep_is_logic_complete).
    • General.lean defines concrete error bound concreteBinaryBasefoldKnowledgeError and scalar knowledge‑soundness theorem.
  • Ring‑Switching:
    • SumcheckPhase.lean rewrites per‑round sumcheck using ReductionLogicStep, adds iteratedSumcheckOracleReduction with perfect completeness proof; defines sumcheckStepLogic and strict round relations.
    • BatchingPhase.lean adds batchingStepLogic (ReductionLogicStep), strict batching input relations, delegates prover/verifier to logic.
    • Prelude.lean adds strict relations (strictSumcheckRoundRelation), AbstractOStmtIn.toStrictRelInput, and generic lemmas for embedded MLP eval, batching correctness, and final‑step tensors.
    • Spec.lean adds many Fintype, Inhabited, IsUniformSpec, SampleableType instances needed for soundness unrolling.
  • FRI‑Binius: CoreInteractionPhase.lean refactors to use strictRoundRelation, strictSumcheckRoundRelation, RingSwitching_BBFSumcheckMultParam; fills all previously sorry‑filled proofs.
  • BBFSmallFieldIOPCS: New file instantiates a small‑field IOPCS by composing Ring‑Switching with Binary Basefold as inner MLIOPCS, proving perfectCompleteness, rbrKnowledgeSoundness, and knowledgeSoundness with concrete error term bbfSmallFieldConcreteKnowledgeError.
  • Cast operations: Cast.lean defines castInOut and castOutSimple for OracleReduction/OracleVerifier, with theorems preserving perfectCompleteness, completeness, and rbrKnowledgeSoundness.
  • General soundness infrastructure: Security/Basic.lean adds soundness_error_mono and knowledgeSoundness_error_mono; Security/RoundByRound.lean adds rbrExtractionFailureEvent (reducible) and rbrKnowledgeSoundness_of_eq_error.

Refactoring

  • Steps.lean → submodules: The large Steps.lean was split into Steps/Fold.lean, Steps/Commit.lean, Steps/Relay.lean, Steps/FinalSumcheck.lean; the parent now merely re‑exports.
  • Query phase: Replaced ad‑hoc verifier logic with OracleAwareReductionLogicStep (queryPhaseLogicStep); queryOracleProver and queryOracleVerifier delegate to checkSingleRepetition and logic step’s proverOut/embed.
  • CoreInteractionPhase: Replaced roundRelation/sumcheckRoundRelation with strict variants throughout; added 𝓑 : Fin 2 ↪ L parameter.
  • General.lean (Binary Basefold, Ring‑Switching): Added [IsDomain K] [IsDomain L] constraints and hInit : NeverFail init hypothesis to completeness and soundness theorems.
  • Spec.lean (Binary Basefold, Ring‑Switching): Many definitions made @[reducible]; d parameter removed (hardcoded to degree 2); added numerous Fintype, Inhabited, IsUniformSpec instances.
  • Prelude.lean (Binary Basefold): OracleFunction index type changed from Fin (ℓ+1) to Fin r; FiberMath subsection refactored with destIdx parameter replacing previous h_i_add_steps/h_i_add_1 arguments.
  • SendClaim.lean: Completeness proof made more explicit using mkVerifierOStmtOut_inl/_inr lemmas.

Infrastructure / CI

  • ArkLib.lean: Added imports for AdditiveNTT, Fin/BigOperators, OracleReduction/Completeness, many Binary Basefold modules, RingSwitching/BBFSmallFieldIOPCS, ToMathlib/MvPolynomial/Equiv, ToVCVio/Lemmas, ToVCVio/Simulation.
  • New module ToVCVio/ with Lemmas.lean (auxiliary probability/support lemmas for OptionT, StateT) and Simulation.lean (bridge between monadic simulations and deterministic logic).
  • Minor linter options added (set_option linter.unusedFintypeInType false, set_option linter.style.setOption false, set_option linter.flexible false) and maxHeartbeats increased in Fin/Sigma.lean.

Documentation

  • blueprint/src/references.bib: Updated the ePrint URL for the Diamond‑Posen 2024 reference to a specific version.

Summary of Missing/Inconsistent Information

The PR body states “Minor changes: reintroduce AdditiveNTT.lean with index changes, will be migrated to CompPoly later.” However, the per‑file summary shows AdditiveNTT.lean as a new 3090‑line file (not a reintroduction) and there is no mention of an existing CompPoly module; this is a minor discrepancy. The PR body also lists certain files (Completeness.lean, ReductionLogic.lean, Simulation.lean, Lemmas.lean) as “tools for converting the monadic defs into the logical defs” – these are indeed present and provide completeness unrolling, reduction logic steps, and simulation lemmas. The archived PRs are referenced but no further context is provided.


Statistics

Metric Count
📝 Files Changed 56
Lines Added 40072
Lines Removed 4112

Lean Declarations

✏️ Removed: 93 declaration(s)

ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean (24)

  • def BBF_SumcheckMultiplierParam : SumcheckMultiplierParam L ℓ (SumcheckBaseContext L ℓ)
  • def BBF_eq_multiplier (r : Fin ℓ → L) : MultilinearPoly L ℓ
  • def badEventExistsProp
  • def finalNonDoomedFoldingProp {h_le : ϑ ≤ ℓ}
  • def finalSumcheckRelOut :
  • def finalSumcheckRelOutProp
  • def foldStepRelOut (i : Fin ℓ) :
  • def foldStepRelOutProp (i : Fin ℓ)
  • def getFoldingChallenges (i : Fin (ℓ + 1)) (challenges : Fin i → L)
  • def getMidCodewords {i : Fin (ℓ + 1)} (t : L⦃≤ 1⦄[X Fin ℓ]) -- original polynomial t
  • def getNextOracle (i : Fin (ℓ + 1))
  • def masterKStateProp (stmtIdx : Fin (ℓ + 1))
  • def nonDoomedFoldingProp (i : Fin (ℓ + 1)) (challenges : Fin i → L)
  • def oracleFoldingConsistencyProp (i : Fin (ℓ + 1)) (challenges : Fin i → L)
  • def oracleWitnessConsistency
  • def roundRelation (i : Fin (ℓ + 1)) :
  • def roundRelationProp (i : Fin (ℓ + 1))
  • def witnessStructuralInvariant {i : Fin (ℓ + 1)} (stmt : Statement (L
  • lemma firstOracleWitnessConsistencyProp_relay_preserved (i : Fin ℓ)
  • lemma getFoldingChallenges_init_succ_eq (i : Fin ℓ)
  • lemma nonDoomedFoldingProp_relay_preserved (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i)
  • lemma oracleWitnessConsistency_relay_preserved
  • lemma oracle_block_k_next_le (i : Fin (ℓ + 1)) (j : Fin (toOutCodewordsCount ℓ ϑ i))
  • noncomputable def foldingBadEventAtBlock

ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean (6)

  • def foldCommitRbrKnowledgeError (i : Fin ℓ)
  • def foldRelayRbrKnowledgeError (i : Fin ℓ)
  • def nonLastBlockFirstRelayRbrKnowledgeError (bIdx : Fin (ℓ / ϑ - 1))
  • def nonLastBlockOracleReduction (bIdx : Fin (ℓ / ϑ - 1))
  • def nonLastBlockOracleVerifier (bIdx : Fin (ℓ / ϑ - 1))
  • def nonLastBlockRbrKnowledgeError (bIdx : Fin (ℓ / ϑ - 1))

ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean (16)

  • def BBF_Code (i : Fin (ℓ + 1)) : Submodule L ((sDomain 𝔽q β h_ℓ_add_R_rate)
  • def BBF_CodeDistance (ℓ 𝓡 : ℕ) (i : Fin (ℓ + 1)) : ℕ
  • def baseFoldMatrix (i : Fin r) (h_i : i + 1 < ℓ + 𝓡)
  • def challengeTensorProduct (steps : ℕ) (r_challenges : Fin steps → L) : Vector L (2 ^ steps)
  • def disagreementSet (i : Fin ℓ) (steps : ℕ) [NeZero steps] (h_i_add_steps : i.val + steps ≤ ℓ)
  • def fiberEvaluationMapping (i : Fin r) (steps : ℕ) (h_i_add_steps : i.val + steps < ℓ + 𝓡)
  • def fiberwiseClose (i : Fin ℓ) (steps : ℕ) [NeZero steps] (h_i_add_steps : i.val + steps ≤ ℓ)
  • def fiberwiseDisagreementSet (i : Fin ℓ) (steps : ℕ) [NeZero steps]
  • def fiberwiseDistance (i : Fin ℓ) (steps : ℕ) [NeZero steps] (h_i_add_steps : i.val + steps ≤ ℓ)
  • def foldingBadEvent (i : Fin ℓ) (steps : ℕ) [NeZero steps] (h_i_add_steps : i + steps ≤ ℓ)
  • def hammingClose (i : Fin (ℓ + 1)) (f : OracleFunction 𝔽q β
  • def isCompliant (i : Fin (ℓ)) (steps : ℕ) [NeZero steps]
  • def localized_fold_eval (i : Fin ℓ) (steps : ℕ) (h_i_add_steps : i + steps ≤ ℓ)
  • def uniqueClosestCodeword
  • lemma farness_implies_non_compliance (i : Fin ℓ) (steps : ℕ) [NeZero steps]
  • theorem fiberwise_dist_lt_imp_dist_lt_unique_decoding_radius (i : Fin ℓ) (steps : ℕ)

ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean (4)

  • def extractNextSuffixFromChallenge (v : sDomain 𝔽q β h_ℓ_add_R_rate ⟨0, by omega⟩)
  • def proximityChecksSpec (γ_challenges :
  • def queryCodeword (j : Fin (toOutCodewordsCount ℓ ϑ (Fin.last ℓ)))
  • def queryRbrKnowledgeError

ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (42)

  • def FinalSumcheckWit
  • def commitKState (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) :
  • def commitKStateProp (i : Fin ℓ) (m : Fin (1 + 1))
  • def commitKnowledgeError {i : Fin ℓ}
  • def commitPrvState (i : Fin ℓ) : Fin (1 + 1) → Type
  • def finalSumcheckKStateProp {m : Fin (1 + 1)} (tr : Transcript m (pSpecFinalSumcheckStep (L
  • def finalSumcheckKnowledgeError (m : pSpecFinalSumcheckStep (L
  • def foldKStateProp {i : Fin ℓ} (m : Fin (2 + 1))
  • def foldKnowledgeError (i : Fin ℓ)
  • def foldKnowledgeStateFunction (i : Fin ℓ) :
  • def foldPrvState (i : Fin ℓ) : Fin (2 + 1) → Type
  • def getCommitProverFinalOutput (i : Fin ℓ)
  • def relayKStateProp (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i)
  • def relayKnowledgeError (m : pSpecRelay.ChallengeIdx) : ℝ≥0
  • def relayKnowledgeStateFunction (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) :
  • def relayPrvState (i : Fin ℓ) : Fin (0 + 1) → Type
  • noncomputable def commitOracleProver (i : Fin ℓ) :
  • noncomputable def commitOracleReduction (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) :
  • noncomputable def commitOracleVerifier (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) :
  • noncomputable def commitRbrExtractor (i : Fin ℓ) :
  • noncomputable def finalSumcheckKnowledgeStateFunction {σ : Type} (init : ProbComp σ)
  • noncomputable def finalSumcheckOracleReduction :
  • noncomputable def finalSumcheckProver :
  • noncomputable def finalSumcheckRbrExtractor :
  • noncomputable def finalSumcheckVerifier :
  • noncomputable def foldOracleProver (i : Fin ℓ) :
  • noncomputable def foldOracleReduction (i : Fin ℓ) :
  • noncomputable def foldOracleVerifier (i : Fin ℓ) :
  • noncomputable def foldRbrExtractor (i : Fin ℓ) :
  • noncomputable def getFoldProverFinalOutput (i : Fin ℓ)
  • noncomputable def relayOracleProver (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) :
  • noncomputable def relayOracleReduction (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) :
  • noncomputable def relayOracleVerifier (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) :
  • noncomputable def relayRbrExtractor (i : Fin ℓ) :
  • theorem commitOracleReduction_perfectCompleteness (i : Fin ℓ)
  • theorem commitOracleVerifier_rbrKnowledgeSoundness (i : Fin ℓ)
  • theorem finalSumcheckOracleReduction_perfectCompleteness {σ : Type}
  • theorem finalSumcheckOracleVerifier_rbrKnowledgeSoundness [Fintype L] {σ : Type}
  • theorem foldOracleReduction_perfectCompleteness (i : Fin ℓ) :
  • theorem foldOracleVerifier_rbrKnowledgeSoundness (i : Fin ℓ) :
  • theorem relayOracleReduction_perfectCompleteness (i : Fin ℓ)
  • theorem relayOracleVerifier_rbrKnowledgeSoundness (i : Fin ℓ)

ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean (1)

  • def getIteratedSumcheckProverFinalOutput (i : Fin ℓ')
✏️ Added: 1003 declaration(s)

ArkLib/Data/CodingTheory/Prelims.lean (3)

  • lemma multilinearWeight_succ {ϑ : ℕ} (r : Fin (ϑ + 1) → F) (i : Fin (2 ^ (ϑ + 1))) :
  • lemma multilinearWeight_succ_lower_half {n : ℕ}
  • lemma multilinearWeight_succ_upper_half {n : ℕ}

ArkLib/Data/CodingTheory/ReedSolomon.lean (1)

  • instance instNontrivial {F ι : Type*} {n : ℕ} [Field F] [Fintype ι] {α : ι ↪ F}

ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean (95)

  • abbrev IntermediateCoeffVecSpace (i : Fin r)
  • def Nat.boundedRecOn {r : ℕ} {motive : (k : ℕ) → k < r → Sort _}
  • def additiveNTTInvariant (evaluation_buffer : Fin (2 ^ (ℓ + R_rate)) → L)
  • def coeffsBySuffix (a : Fin (2 ^ ℓ) → L) (i : Fin r) (h_i : i ≤ ℓ) (v : Fin (2 ^ i.val)) :
  • def finToBinaryCoeffs (i : Fin r) (idx : Fin (2 ^ (ℓ + R_rate - i.val))) :
  • def intermediateToCoeffsVec (i : Fin r) : -- (h_i : i ≤ ℓ)
  • def sBasis (i : Fin r) (h_i : i < ℓ + R_rate) : Fin (ℓ + R_rate - i) → L
  • def splitPointIntoCoeffs (i : Fin r) (h_i : i < ℓ + R_rate)
  • def tileCoeffs (a : Fin (2 ^ ℓ) → L) : Fin (2^(ℓ + R_rate)) → L
  • lemma NTTStage_correctness (i : Fin (ℓ))
  • lemma base_coeffsBySuffix (a : Fin (2 ^ ℓ) → L) :
  • lemma degree_intermediateEvaluationPoly_lt (i : Fin r) (h_i : i ≤ ℓ)
  • lemma degree_intermediateNormVpoly (i : Fin r) {k : ℕ} (h_k : i.val + k ≤ ℓ) :
  • lemma degree_intermediateNovelBasisX (i : Fin r) (h_i : i ≤ ℓ) (j : Fin (2 ^ (ℓ - i))) :
  • lemma degree_qMap (i : Fin r) : (qMap 𝔽q β i).degree = 2
  • lemma eval_point_ω_eq_next_twiddleFactor_comp_qmap
  • lemma evaluationPointω_eq_twiddleFactor_of_div_2 (i : Fin r) (h_i : i < ℓ)
  • lemma even_index_intermediate_novel_basis_decomposition (i : Fin r)
  • lemma finToBinaryCoeffs_sDomainToFin (i : Fin r) (h_i : i < ℓ + R_rate)
  • lemma foldl_NTTStage_inductive_aux (h_ℓ : ℓ ≤ r) (k : Fin (ℓ + 1))
  • lemma getSDomainBasisCoeff_of_iteratedQuotientMap
  • lemma getSDomainBasisCoeff_of_sum_repr [NeZero R_rate] (i : Fin r) (h_i : i ≤ ℓ)
  • lemma get_sDomain_basis (i : Fin r) (h_i : i < ℓ + R_rate) :
  • lemma get_sDomain_first_basis_eq_1 (i : Fin r) (h_i : i < ℓ + R_rate) :
  • lemma initial_tiled_coeffs_correctness (h_ℓ : ℓ ≤ r) (a : Fin (2 ^ ℓ) → L) :
  • lemma intermediateEvaluationPoly_from_inovel_coeffs_eq_self
  • lemma intermediateNormVpoly_eval_is_linear_map (i : Fin r) {k : ℕ} (h_k : i.val + k ≤ ℓ) :
  • lemma intermediateNovelBasisX_zero_eq_one (i : Fin r) (h_i : i ≤ ℓ) :
  • lemma intermediate_poly_P_base (h_ℓ : ℓ ≤ r) (coeffs : Fin (2 ^ ℓ) → L) :
  • lemma iteratedQuotientMap_congr_k
  • lemma mem_sDomain_of_eq {i j : Fin r} (h : i.val = j.val)
  • lemma natDegree_intermediateNormVpoly (i : Fin r) {k : ℕ} (h_k : i.val + k ≤ ℓ) :
  • lemma natDegree_qMap (i : Fin r) : (qMap 𝔽q β i).natDegree = 2
  • lemma normalizedW_eq_qMap_composition (ℓ R_rate : ℕ) (i : Fin r) :
  • lemma odd_index_intermediate_novel_basis_decomposition
  • lemma qCompositionChain_eq_foldl (i : Fin r) :
  • lemma qMap_comp_normalizedW (i : Fin r) (h_i_add_1 : i + 1 < r) :
  • lemma qMap_eval_mem_sDomain_succ (i : Fin r) {destIdx : Fin r}
  • lemma qMap_ne_zero (i : Fin r) : (qMap 𝔽q β i) ≠ 0
  • lemma sBasis_range_eq (i : Fin r) (h_i : i < ℓ + R_rate) :
  • lemma sDomainBasisVectors_mem_sDomain (i : Fin r) (k : Fin (ℓ + R_rate - i)) :
  • lemma sDomain_card (i : Fin r) (h_i : i < ℓ + R_rate) :
  • lemma sDomain_eq_image_of_upper_span (i : Fin r) (h_i : i < ℓ + R_rate) :
  • lemma sDomain_eq_of_eq {i j : Fin r} (h : i = j) :
  • lemma 𝔽q_element_eq_zero_or_eq_one : ∀ c: 𝔽q, c = 0 ∨ c = 1
  • noncomputable def NTTStage (i : Fin r) (h_i : i < ℓ) (b : Fin (2 ^ (ℓ + R_rate)) → L) :
  • noncomputable def additiveNTT (a : Fin (2 ^ ℓ) → L) : Fin (2^(ℓ + R_rate)) → L
  • noncomputable def evaluationPointω (i : Fin r) (h_i : i ≤ ℓ)
  • noncomputable def evenRefinement (i : Fin r) (h_i : i < ℓ)
  • noncomputable def finToSDomain (i : Fin r) (h_i : i < ℓ + R_rate)
  • noncomputable def getINovelCoeffs (i : Fin r) (h_i : i ≤ ℓ)
  • noncomputable def iNovelToMonomialCoeffs (i : Fin r) (h_i : i ≤ ℓ)
  • noncomputable def intermediateBasisVectors (i : Fin r) (h_i : i ≤ ℓ) :
  • noncomputable def intermediateChangeOfBasisMatrix (i : Fin r) (h_i : i ≤ ℓ) :
  • noncomputable def intermediateEvaluationPoly (i : Fin r) (h_i : i ≤ ℓ)
  • noncomputable def intermediateNormVpoly
  • noncomputable def intermediateNovelBasisX (i : Fin r) (h_i : i ≤ ℓ)
  • noncomputable def iteratedQuotientMap [NeZero ℓ] (i : Fin r) {destIdx : Fin r} {k : ℕ}
  • noncomputable def monomialToINovelCoeffs (i : Fin r) (h_i : i ≤ ℓ)
  • noncomputable def oddRefinement (i : Fin r) (h_i : i < ℓ)
  • noncomputable def qCompositionChain (i : Fin r) : L[X]
  • noncomputable def qMap (i : Fin r) : L[X]
  • noncomputable def sDomain (i : Fin r) : Subspace 𝔽q L
  • noncomputable def sDomain.lift (i j : Fin r) (h_j : j < ℓ + R_rate) (h_le : i ≤ j)
  • noncomputable def sDomainBasisVectors (i : Fin r) : Fin (ℓ + R_rate - i) → L
  • noncomputable def sDomainFinEquiv (i : Fin r) (h_i : i < ℓ + R_rate)
  • noncomputable def sDomainToFin (i : Fin r) (h_i : i < ℓ + R_rate)
  • noncomputable def sDomain_basis (i : Fin r) (h_i : i < ℓ + R_rate) :
  • noncomputable def sDomain_cast {i j : Fin r} (h : i = j) :
  • noncomputable def twiddleFactor (i : Fin r) (h_i : i < ℓ)
  • noncomputable instance fintype_sDomain (i : Fin r) :
  • noncomputable instance intermediateChangeOfBasisMatrix_invertible (i : Fin r) (h_i : i ≤ ℓ) :
  • theorem Polynomial.comp_same_inner_eq_if_same_outer (f g : L[X]) (h_f_eq_g : f = g) :
  • theorem Polynomial.foldl_comp (n : ℕ) (f : Fin n → L[X]) : ∀ initInner initOuter: L[X],
  • theorem additiveNTT_correctness (h_ℓ : ℓ ≤ r)
  • theorem base_intermediateNormVpoly
  • theorem base_intermediateNovelBasisX (j : Fin (2 ^ ℓ)) :
  • theorem basis_repr_of_sDomain_lift (i j : Fin r) (h_j : j < ℓ + R_rate) (h_le : i ≤ j)
  • theorem evaluation_poly_split_identity (i : Fin r) (h_i : i < ℓ)
  • theorem evenRefinement_eq_novel_poly_of_0_leading_suffix (i : Fin r) (h_i : i < ℓ) (v : Fin (2 ^ i.val))
  • theorem iNovelToMonomial_monomialToINovel_inverse (i : Fin r) (h_i : i ≤ ℓ)
  • theorem intermediateChangeOfBasisMatrix_det_ne_zero (i : Fin r) (h_i : i ≤ ℓ) :
  • theorem intermediateChangeOfBasisMatrix_diag_ne_zero (i : Fin r) (h_i : i ≤ ℓ) :
  • theorem intermediateChangeOfBasisMatrix_lower_triangular (i : Fin r) (h_i : i ≤ ℓ) :
  • theorem intermediateNormVpoly_comp (i : Fin r) {destIdx : Fin r}
  • theorem intermediateNormVpoly_comp_qmap (i : Fin r)
  • theorem intermediateNormVpoly_comp_qmap_helper (i : Fin r) (h_i : i < ℓ)
  • theorem iteratedQuotientMap_k_eq_1_is_qMap (i : Fin r) {destIdx : Fin r}
  • theorem iteratedQuotientMap_succ_comp
  • theorem monomialToINovel_iNovelToMonomial_inverse (i : Fin r) (h_i : i ≤ ℓ)
  • theorem oddRefinement_eq_novel_poly_of_1_leading_suffix (i : Fin r) (h_i : i < ℓ) (v : Fin (2 ^ i.val))
  • theorem qMap_eval_𝔽q_eq_0 (i : Fin r) :
  • theorem qMap_is_linear_map (i : Fin r) :
  • theorem qMap_maps_sDomain (i : Fin r) (h_i_add_1 : i + 1 < r) :
  • theorem sDomainFin_bijective (i : Fin r) (h_i : i < ℓ + R_rate)

ArkLib/Data/Fin/BigOperators.lean (29)

  • def Fin.reindex {R n m : Type*} [Fintype n] [Fintype m] (e : n ≃ m) (v : n → R)
  • def Matrix.from4Blocks {mTop nLeft mBot nRight : ℕ} {α : Type*}
  • def finTwoPowAddTwoPowEquiv (n : ℕ) : Fin (2 ^ n + 2 ^ n) ≃ Fin (2 ^ (n + 1))
  • def finTwoPowSumEquiv (n : ℕ) : Fin (2 ^ n) ⊕ Fin (2 ^ n) ≃ Fin (2 ^ (n + 1))
  • def mergeFinMap_PO2_left_right {L : Type*} {n : ℕ} (left : Fin (2 ^ n) → L)
  • def reindexVecTwoPowAddTwoPow {L : Type*} {n : ℕ} (v : Fin (2 ^ n + 2 ^ n) → L)
  • def splitFinMap_PO2_left {L : Type*} {n : ℕ} (v : Fin (2 ^ (n + 1)) → L)
  • def splitFinMap_PO2_right {L : Type*} {n : ℕ} (v : Fin (2 ^ (n + 1)) → L)
  • lemma Fin.reindex_reindex {R n m l : Type*} [Fintype n] [Fintype m] [Fintype l]
  • lemma Fin.reindex_reindex_symm {R n m : Type*} [Fintype n] [Fintype m]
  • lemma Matrix.det_from4Blocks_of_squareSubblocks_commute {n : ℕ} {R : Type*}
  • lemma Matrix.det_fromBlocks_of_squareSubblocks_commute {n : ℕ} {R : Type*} [CommRing R]
  • lemma Matrix.det_map_ringHom {n : Type*} [Fintype n] [DecidableEq n] {R S : Type*}
  • lemma Matrix.from4Blocks_eq_fromBlocks {m n : ℕ} {α : Type*}
  • lemma Matrix.from4Blocks_mul_from4Blocks {mTop mBot pLeft pRight nLeft nRight : ℕ} {α : Type*}
  • lemma Matrix.map_neg_ringHom {m n : Type*} {R S : Type*} [Ring R] [Ring S]
  • lemma Matrix.mulVec_reindex {m n l : Type*} [Fintype n] [Fintype l]
  • lemma Matrix.reindex_mulVec {m n o l : Type*} [Fintype n] [Fintype l] [Fintype m] [Fintype o]
  • lemma Matrix.reindex_mulVec_reindex {m n o l : Type*} [Fintype n] [Fintype l] [Fintype m]
  • lemma Matrix.reindex_mul_eq_prod_of_reindex {l m n o p q : Type*}
  • lemma Matrix.reindex_mul_reindex {l m n o p q : Type*} [Fintype n] [Fintype p]
  • lemma Matrix.reindex_vecMul {m n l : Type*} [Fintype m] [Fintype l]
  • lemma Matrix.reindex_vecMul_reindex {m n o l : Type*} [Fintype n] [Fintype l] [Fintype m]
  • lemma Matrix.vecMul_reindex {m n o l : Type*} [Fintype m] [Fintype o] [Fintype n] [Fintype l]
  • lemma eq_split_finMap_PO2_iff_merge_finMap_PO2_eq {L : Type*} {n : ℕ} (v : Fin (2 ^ (n + 1)) → L)
  • lemma finTwoPowSumEquiv_apply_left (n : ℕ) (x : Fin (2 ^ n)) :
  • lemma finTwoPowSumEquiv_apply_right (n : ℕ) (x : Fin (2 ^ n)) :
  • lemma mergeFinMap_PO2_of_split_left_right {L : Type*} {n : ℕ} (v : Fin (2 ^ (n + 1)) → L) :
  • theorem Fin.sum_univ_odd_even {M : Type*} [AddCommMonoid M] (n : ℕ) (f : ℕ → M) :

ArkLib/Data/Misc/Basic.lean (3)

  • lemma cast_fun_eq_fun_cast_arg.{u, v} {A B : Type u} {C : Type v} (h : A = B) (f : A → C) :
  • lemma fun_eta_expansion {α β : Type*} (f : α → β) : f = (fun x => f x)
  • lemma fun_eta_expansion_apply {α β : Type*} (f : α → β) (x : α) : (f x) = (fun x => f x) x

ArkLib/Data/MvPolynomial/RestrictDegree.lean (1)

  • theorem fixFirstVariablesOfMQP_zero_eq (H : MvPolynomial (Fin ℓ) L) :

ArkLib/Data/Probability/Instances.lean (6)

  • lemma prob_poly_agreement_degree_one {R : Type} [CommRing R] [IsDomain R] [Fintype R]
  • lemma prob_poly_agreement_degree_two {R : Type} [CommRing R] [IsDomain R] [Fintype R]
  • lemma prob_schwartz_zippel_univariate_deg {R : Type} [CommRing R] [IsDomain R] [Fintype R]
  • theorem Pr_or_le {α : Type} (D : PMF α)
  • theorem prob_pow_bound_of_forall
  • theorem prob_pow_of_forall_finFun

ArkLib/OracleReduction/Basic.lean (5)

  • def FullTranscript.mk1 {pSpec : ProtocolSpec 1} (msg0 : pSpec.«Type» 0) :
  • def mkVerifierOStmtOut
  • lemma mkVerifierOStmtOut_inl
  • lemma mkVerifierOStmtOut_inr
  • theorem FullTranscript.mk1_eq_snoc {pSpec : ProtocolSpec 1} (msg0 : pSpec.«Type» 0) :

ArkLib/OracleReduction/Cast.lean (10)

  • def castInOut
  • def castOutSimple
  • theorem castInOut_completeness
  • theorem castInOut_id
  • theorem castInOut_perfectCompleteness
  • theorem castInOut_rbrKnowledgeSoundness
  • theorem castOutSimple_completeness

…and 853 more not listed.

✏️ Affected: 60 declaration(s) (line number changed)
  • def extractMLP (i : Fin ℓ) (f : (sDomain 𝔽q β h_ℓ_add_R_rate) ⟨i, by omega⟩ → L) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L518 to L1195
  • def firstOracleWitnessConsistencyProp (t : MultilinearPoly L ℓ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L835 to L1150
  • def getFirstOracle {oracleFrontierIdx : Fin (ℓ + 1)} in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L714 to L1913
  • def snoc_oracle {i : Fin ℓ} {destIdx : Fin r} (h_destIdx : destIdx = i.val + 1) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L620 to L1865
  • def take_snoc_oracle (i : Fin ℓ) {destIdx : Fin r} (h_destIdx : destIdx = i.val + 1) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L691 to L1885
  • lemma oracle_block_k_bound (i : Fin (ℓ + 1)) (j : Fin (toOutCodewordsCount ℓ ϑ i)) : in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L745 to L350
  • lemma take_snoc_oracle_eq_oStmtIn (i : Fin ℓ) {destIdx : Fin r} (h_destIdx : destIdx = i.val + 1) in ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean moved from L704 to L1899
  • def lastBlockRbrKnowledgeError (k : (pSpecLastBlock (L in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean moved from L660 to L1240
  • def sumcheckFoldKnowledgeError (j : (pSpecSumcheckFold 𝔽q β (ϑ in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean moved from L681 to L1572
  • def sumcheckFoldOracleReduction : OracleReduction []ₒ in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean moved from L550 to L841
  • theorem coreInteractionOracleReduction_perfectCompleteness (hInit : NeverFail init) in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean moved from L750 to L1692
  • theorem sumcheckFoldOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean moved from L605 to L1125
  • theorem fullOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/BinaryBasefold/General.lean moved from L110 to L115
  • abbrev OracleFunction (domainIdx : Fin r) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L106 to L609
  • def fold (i : Fin r) {destIdx : Fin r} (h_destIdx : destIdx = i.val + 1) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L623 to L1372
  • def foldMatrix (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L648 to L1491
  • def iterated_fold (i : Fin r) (steps : ℕ) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L661 to L1589
  • def localized_fold_matrix_form (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L768 to L2138
  • def pointToIterateQuotientIndex (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L239 to L839
  • lemma pointToIterateQuotientIndex_qMap_total_fiber_eq_self (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L397 to L997
  • lemma qMap_total_fiber_basis_sum_repr (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L429 to L1027
  • lemma qMap_total_fiber_one_level_eq (i : Fin r) {destIdx : Fin r} in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L256 to L857
  • lemma qMap_total_fiber_repr_coeff (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L215 to L813
  • theorem card_qMap_total_fiber (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L469 to L1114
  • theorem is_fiber_iff_generates_quotient_point (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L332 to L937
  • theorem iterated_fold_eq_matrix_form (i : Fin r) {destIdx : Fin r} (steps : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean moved from L798 to L2267
  • def queryKStateProp (m : Fin (1 + 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean moved from L359 to L2605
  • theorem queryOracleVerifier_rbrKnowledgeSoundness {σ : Type} (init : ProbComp σ) in ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean moved from L405 to L2858
  • def pSpecCoreInteraction in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean moved from L251 to L277
  • def pSpecFold : ProtocolSpec 2 in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean moved from L201 to L224
  • def pSpecFoldCommit (i : Fin ℓ) : ProtocolSpec (3) in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean moved from L217 to L239
  • def pSpecFoldRelay : ProtocolSpec (2) in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean moved from L221 to L243
  • def pSpecFoldRelaySequence (n : ℕ) in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean moved from L225 to L248
  • def pSpecFullNonLastBlock (bIdx : Fin (ℓ / ϑ - 1)) in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean moved from L230 to L254
  • def pSpecLastBlock in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean moved from L238 to L262
  • def pSpecNonLastBlocks in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean moved from L241 to L266
  • def pSpecSumcheckFold in ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean moved from L246 to L272
  • instance sumcheckFoldExtractorLens_rbr_knowledge_soundness in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean moved from L278 to L401
  • theorem coreInteractionOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean moved from L661 to L1761
  • theorem sumcheckFoldOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean moved from L212 to L335
  • @[reducible] def batchingCorePspec in ArkLib/ProofSystem/Binius/FRIBinius/General.lean moved from L56 to L56
  • @[reducible] def fullPspec in ArkLib/ProofSystem/Binius/FRIBinius/General.lean moved from L59 to L59
  • theorem fullOracleReduction_perfectCompleteness (hInit : NeverFail init) : in ArkLib/ProofSystem/Binius/FRIBinius/General.lean moved from L180 to L188
  • def BinaryBasefoldAbstractOStmtIn : (RingSwitching.AbstractOStmtIn (L in ArkLib/ProofSystem/Binius/FRIBinius/Prelude.lean moved from L50 to L52
  • def batchingInputRelation : in ArkLib/ProofSystem/RingSwitching/BatchingPhase.lean moved from L198 to L101
  • def batchingInputRelationProp (stmt : BatchingStmtIn L ℓ) in ArkLib/ProofSystem/RingSwitching/BatchingPhase.lean moved from L191 to L94
  • noncomputable def batchingKnowledgeStateFunction [IsDomain K] [IsDomain L] : in ArkLib/ProofSystem/RingSwitching/BatchingPhase.lean moved from L288 to L385
  • theorem batchingOracleVerifier_rbrKnowledgeSoundness [IsDomain K] [IsDomain L] : in ArkLib/ProofSystem/RingSwitching/BatchingPhase.lean moved from L327 to L1297
  • theorem batchingReduction_perfectCompleteness [IsDomain K] [IsDomain L] (hInit : NeverFail init) : in ArkLib/ProofSystem/RingSwitching/BatchingPhase.lean moved from L315 to L678
  • lemma batchingCore_perfectCompleteness [IsDomain K] [IsDomain L] (hInit : NeverFail init) : in ArkLib/ProofSystem/RingSwitching/General.lean moved from L106 to L106
  • theorem fullOracleReduction_perfectCompleteness [IsDomain K] [IsDomain L] in ArkLib/ProofSystem/RingSwitching/General.lean moved from L119 to L119
  • theorem fullOracleVerifier_rbrKnowledgeSoundness [IsDomain K] [IsDomain L] : in ArkLib/ProofSystem/RingSwitching/General.lean moved from L145 to L147
  • def iteratedSumcheckPrvState (i : Fin ℓ') : Fin (2 + 1) → Type in ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean moved from L80 to L150
  • noncomputable def finalSumcheckKnowledgeStateFunction [IsDomain L] {σ : Type} (init : ProbComp σ) in ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean moved from L451 to L1662
  • noncomputable def iteratedSumcheckOracleProver (i : Fin ℓ') : in ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean moved from L93 to L160
  • noncomputable def iteratedSumcheckOracleReduction (i : Fin ℓ') : in ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean moved from L118 to L210
  • noncomputable def iteratedSumcheckOracleVerifier (i : Fin ℓ') : in ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean moved from L106 to L189
  • theorem coreInteraction_perfectCompleteness [IsDomain L] (hInit : NeverFail init) : in ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean moved from L537 to L1905
  • theorem finalSumcheckOracleReduction_perfectCompleteness [IsDomain L] {σ : Type} in ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean moved from L382 to L1446
  • theorem iteratedSumcheckOracleReduction_perfectCompleteness (i : Fin ℓ') in ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean moved from L136 to L520

sorry Tracking

Removed: 48 `sorry`(s)

ArkLib/Data/Fin/Sigma.lean (1)

  • theorem dflatten_splitSum {m : ℕ} {n : Fin m → ℕ} {motive : (k : Fin (vsum n)) → Sort*} (L220)

ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean (2)

  • lemma nonDoomedFoldingProp_relay_preserved (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) (L895)
  • lemma oracleWitnessConsistency_relay_preserved (L927)

ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean (2)

  • theorem sumcheckFoldOracleReduction_perfectCompleteness : (L617)
  • theorem sumcheckFoldOracleVerifier_rbrKnowledgeSoundness : (L703)

ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean (3)

  • def foldMatrix (i : Fin r) (steps : Fin (ℓ + 1)) (h_i_add_steps : i.val + steps < ℓ + 𝓡) (L658)
  • lemma iterated_fold_transitivity (L715)
  • theorem iterated_fold_eq_matrix_form (i : Fin ℓ) (steps : ℕ) (h_i_add_steps : i + steps ≤ ℓ) (L809)

ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean (4)

  • noncomputable def queryKnowledgeStateFunction {σ : Type} (init : ProbComp σ) (L402)
  • noncomputable def queryOracleVerifier : (L271)
  • theorem queryOracleProof_perfectCompleteness {σ : Type} (L341)
  • theorem queryOracleVerifier_rbrKnowledgeSoundness [Fintype L] {σ : Type} (init : ProbComp σ) (L416)

ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean (13)

  • def commitKState (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) : (L634)
  • def commitKState (i : Fin ℓ) (hCR : isCommitmentRound ℓ ϑ i) : (L636)
  • def foldKnowledgeStateFunction (i : Fin ℓ) : (L392)
  • def foldKnowledgeStateFunction (i : Fin ℓ) : (L393)
  • def relayKnowledgeStateFunction (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) : (L808)
  • def relayKnowledgeStateFunction (i : Fin ℓ) (hNCR : ¬ isCommitmentRound ℓ ϑ i) : (L810)
  • noncomputable def finalSumcheckKnowledgeStateFunction {σ : Type} (init : ProbComp σ) (L1066)
  • noncomputable def finalSumcheckKnowledgeStateFunction {σ : Type} (init : ProbComp σ) (L1068)
  • theorem commitOracleReduction_perfectCompleteness (i : Fin ℓ) (L563)
  • theorem finalSumcheckOracleReduction_perfectCompleteness {σ : Type} (L973)
  • theorem foldOracleReduction_perfectCompleteness (i : Fin ℓ) : (L241)
  • theorem foldOracleVerifier_rbrKnowledgeSoundness (i : Fin ℓ) : (L410)
  • theorem relayOracleReduction_perfectCompleteness (i : Fin ℓ) (L752)

ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean (9)

  • instance sumcheckFoldCtxLens_complete : (L206)
  • instance sumcheckFoldCtxLens_complete : (L208)
  • instance sumcheckFoldExtractorLens_rbr_knowledge_soundness : (L318)
  • instance sumcheckFoldExtractorLens_rbr_knowledge_soundness : (L320)
  • noncomputable def finalSumcheckKnowledgeStateFunction {σ : Type} (init : ProbComp σ) (L596)
  • noncomputable def finalSumcheckKnowledgeStateFunction {σ : Type} (init : ProbComp σ) (L598)
  • theorem finalSumcheckOracleReduction_perfectCompleteness {σ : Type} (L491)
  • theorem finalSumcheckOracleVerifier_rbrKnowledgeSoundness [Fintype L] {σ : Type} (L613)
  • theorem sumcheckFoldOracleVerifier_rbrKnowledgeSoundness [Fintype L] : (L352)

ArkLib/ProofSystem/RingSwitching/BatchingPhase.lean (4)

  • noncomputable def batchingKnowledgeStateFunction : (L308)
  • noncomputable def batchingKnowledgeStateFunction : (L310)
  • theorem batchingOracleVerifier_rbrKnowledgeSoundness [IsDomain L] : (L344)
  • theorem batchingReduction_perfectCompleteness : (L324)

ArkLib/ProofSystem/RingSwitching/General.lean (2)

  • theorem fullOracleVerifier_rbrKnowledgeSoundness [IsDomain L] : (L180)
  • theorem fullOracleVerifier_rbrKnowledgeSoundness [IsDomain L] : (L184)

ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean (8)

  • def iteratedSumcheckKnowledgeStateFunction (i : Fin ℓ') : (L271)
  • noncomputable def finalSumcheckKnowledgeStateFunction {σ : Type} (init : ProbComp σ) (L465)
  • noncomputable def finalSumcheckKnowledgeStateFunction {σ : Type} (init : ProbComp σ) (L467)
  • theorem coreInteraction_rbrKnowledgeSoundness [IsDomain L] : (L604)
  • theorem finalSumcheckOracleReduction_perfectCompleteness {σ : Type} (L394)
  • theorem finalSumcheckOracleVerifier_rbrKnowledgeSoundness [Fintype L] [IsDomain L] {σ : Type} (L480)
  • theorem iteratedSumcheckOracleReduction_perfectCompleteness (i : Fin ℓ') : (L147)
  • theorem iteratedSumcheckOracleVerifier_rbrKnowledgeSoundness [IsDomain L] (i : Fin ℓ') : (L283)

Coverage Notes

  • AI file summarization partially analyzed 15 file(s) because their individual diffs exceeded the per-file size budget. Statistics and Lean signal tracking still cover the full PR.
Partially Analyzed Files
  • ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean (+3090/-0)
  • ArkLib/OracleReduction/Completeness.lean (+1403/-0)
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean (+1365/-490)
  • ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean (+2516/-458)
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean (+2313/-1041)
  • ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean (+2735/-274)
  • ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean (+1316/-0)
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean (+1318/-0)
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean (+1836/-0)
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/FinalSumcheck.lean (+1923/-0)
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean (+1762/-0)
  • ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean (+1372/-238)
  • ArkLib/ProofSystem/RingSwitching/BatchingPhase.lean (+1065/-94)
  • ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean (+1634/-223)
  • ArkLib/ToVCVio/Simulation.lean (+2484/-0)
* Additional-instructions analysis was skipped because the full diff exceeded the analysis size budget, and partial results would be misleading.

Last updated: 2026-07-07 17:47 UTC.

chung-thai-nguyen and others added 3 commits July 7, 2026 15:02
Resolve 145 conflict hunks across 19 files per policy: Binius-related files
(BinaryBasefold, FRIBinius, RingSwitching) taken as ours (supersets carrying
our proofs); infra follows main; ArkLib.lean regenerated.

Seam fixes for main's renamed/moved APIs: RestrictDegree, Probability/Instances,
and CodingTheory AffineSpaces restored to ours (they carry our Binius-supporting
lemmas incl. prob_mono). Full build green (4056 jobs, 0 errors).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chung-thai-nguyen
chung-thai-nguyen force-pushed the completeness-of-binius branch from e91496a to 0773f39 Compare July 7, 2026 16:10
@chung-thai-nguyen
chung-thai-nguyen force-pushed the completeness-of-binius branch from 0773f39 to 39e0a4d Compare July 7, 2026 16:13
@chung-thai-nguyen
chung-thai-nguyen marked this pull request as ready for review July 7, 2026 16:15
The `Time validation wrapper` CI step (`./scripts/validate.sh`) failed on its
"Data warning budget" check (`check-warning-log.py`), which rejects any non-`sorry`
warning under `ArkLib/Data/`. This clears all 106:

- Deprecated renames: not_lt_zero', Fin.coe_castSucc, Finsupp/Polynomial finsetSum,
  push_neg -> push Not.
- Probability/Instances: removed unused DecidablePred binders (+ classical),
  removed unused simp args, relaxed longLine for the long Pr_{ ... } calc steps.
- FieldTheory/AdditiveNTT: bumped longFile to 3200 and relaxed the noisy style/
  section-var linters for this large infrastructure file (extends the existing
  longFile relaxation; unused-hypothesis suppressions avoid changing the
  correctness theorems' API that Binius depends on); fixed a missed deprecation
  and an empty-line-in-command.
- Fin/BigOperators, Fin/Sigma, MvPolynomial/RestrictDegree, CodingTheory/{ReedSolomon,
  Prelims}: removed unused simp args, wrapped a long line, scoped set_options.
@alexanderlhicks

alexanderlhicks commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Thanks! Will quickly test the update review workflow on this to make sure it handles larger PRs (else I'll tweak token limit parameters).

edit: token limits in the workflow setting got in the way, removed them.

@alexanderlhicks

Copy link
Copy Markdown
Collaborator

/review

1 similar comment
@alexanderlhicks

Copy link
Copy Markdown
Collaborator

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Reviewed at commit a447fd8fd0a2.

Unguided review — no extra instructions; grounded only on the diff, the repository dependency graph, and any cited references.

Verdict (deterministic): Changes Requested

Basis:

  • 7 critical misformalization(s) and 4 Lean/Mathlib issue(s) across files.
  • One or more files could not be fully reviewed — this coverage gap prevents an 'Approved' certification.

Overall Summary:
TL;DR: The PR implements a large formalization of the Binary Basefold protocol with substantial completeness and soundness proofs. However, several critical compilation errors and incomplete proofs block the code from being accepted: missing arguments, type mismatches, undefined identifiers, and broken proof steps. These must be fixed before the PR can be merged.

Mechanical Pre-Check Results: Mechanical pre‑checks found several pre‑existing sorry escape hatches in touched files (listed in the pre‑check report), but these are not introduced by the PR and do not affect the verdict. No new escape hatches were introduced by the diff. File size warnings are present for many large files, but these are informational only and do not affect the verdict.

Checklist Coverage: No specification checklist was provided.

Cross-File Issues: Cross-file analysis found no composition issues, axiom impact, or external dependency problems. The main composition chain is consistent, and the error bounds are composed correctly via established lemmas. The only potential gap is that the soundness of the query phase depends on prop_4_23_singleRepetition_proximityCheck_bound from Soundness/QueryPhaseSoundness.lean, which is not fully verified in the diff; however, the cross-file analysis marks this as high confidence and not a missing cross-file verification. No cross-file issues are presented.

Critical Misformalizations:

  • Duplicate have name h_2_fw_dist_mul_2_pow_steps_le shadows the first inequality, making the proof of pairUDRClose_of_pairFiberwiseClose invalid. The subsequent omega call cannot see the needed inequality. (ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean) (confidence: high)
    • Evidence: In pairUDRClose_of_pairFiberwiseClose (ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean:731-732), the second have uses the same name as the first.
    • Suggested fix: Rename the first have to e.g. h_ineq and the second to h_eq, then chain them with calc or apply instead of omega.
  • Type mismatch: hypotheses h_destIdx in the new definitions are typed as destIdx = i + steps (Fin equality), but the imported functions iterated_fold and fiberwiseDisagreementSet expect h_destIdx of type destIdx.val = i.val + steps (Nat equality). The file is non-compilable. (ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean) (confidence: high)
    • Evidence: Review of Compliance.lean indicates that the supplied h_destIdx has the wrong type. The structured review notes the file does not compile.
    • Suggested fix: Adjust the hypotheses to use Nat equality, or provide Fin-to-Nat coercions that match the expected argument types.
  • Missing mp argument in the statement of fullOracleVerifier_rbrKnowledgeSoundness, causing the call roundRelation ... (𝓑:=𝓑) 0 to be ill‑typed. The roundRelation function requires mp as an explicit argument. (ArkLib/ProofSystem/Binius/BinaryBasefold/General.lean) (confidence: high)
    • Evidence: Diff of General.lean shows roundRelation (mp := BBF_SumcheckMultiplierParam) … was changed to roundRelation … (𝓑:=𝓑) 0 without mp.
    • Suggested fix: Restore the mp := BBF_SumcheckMultiplierParam argument in the call.
  • Incomplete proof in lemma_4_24_dist_folded_ge_of_last_noncompliant (Case 2, fiberwise far). The proof ends after norm_cast without closing the inequality goal, leaving the theorem unproved. (ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/FoldDistance.lean) (confidence: high)
    • Evidence: After norm_cast at h_no_bad_event_alt, there is no exact or apply closing the goal. The proof is incomplete.
    • Suggested fix: Complete the proof by bridging the and ℕ∞ inequalities, e.g. using exact_mod_cast h_no_bad_event_alt or by applying ENNReal.le_of_lt with norm_cast.
  • Undefined inst_5 in the SampleableType instance for pSpecFinalSumcheckStep challenges, causing a compilation error. (ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean) (confidence: high)
    • Evidence: In Spec.lean, the instance uses exact inst_5 which is not defined anywhere.
    • Suggested fix: Replace the instance with nomatch or IsEmpty.elim because the challenge index is empty.
  • The proof of Matrix.det_fromBlocks_of_squareSubblocks_commute incorrectly uses det_fromBlocks_zero₂₁ on R_mat (which has non‑zero bottom‑left) and det_fromBlocks_zero₁₂ on Res_mat (which has non‑zero top‑right). The lemmas are swapped; the proof is invalid. (ArkLib/Data/Fin/BigOperators.lean) (confidence: high)
    • Evidence: ArkLib/Data/Fin/BigOperators.lean:437‑438 shows the rewrites.
    • Suggested fix: Swap the lemmas: use det_fromBlocks_zero₁₂ for R_mat and det_fromBlocks_zero₂₁ for Res_mat.
  • qMap is defined for all Fin r using i + 1 (Fin addition modulo r), which wraps at the boundary. When i is the last index, i+1 = 0, making the definition mathematically incorrect. Downstream lemmas add the hypothesis i+1 < r but the definition itself is globally available without that guard. (ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean) (confidence: high)
    • Evidence: ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean:190 definition of qMap.
    • Suggested fix: Change qMap to take an explicit hypothesis (h : i.val + 1 < r) or change the type to (i : Fin (r-1)).
  • The proof of polynomial.toMvPolynomial_totalDegree_le contains a broken rw step that replaces the goal with a sum form, but the subsequent exact uses Polynomial.le_natDegree_of_mem_supp which no longer matches the goal. The proof is invalid. (ArkLib/ToMathlib/MvPolynomial/Equiv.lean) (confidence: high)
    • Evidence: ArkLib/ToMathlib/MvPolynomial/Equiv.lean: the rw [← Polynomial.as_sum_support p] line changes the goal incorrectly.
    • Suggested fix: Remove the offending rw line and instead use the induction hypothesis directly.
  • The batchingVerifierCheck is defined to return a Prop, but the verifier’s guard expects a Bool. This causes a type error in the verifier construction. (ArkLib/ProofSystem/RingSwitching/BatchingPhase.lean) (confidence: high)
    • Evidence: Review of BatchingPhase.lean notes that the verifier uses guard with a Prop but guard requires Bool.
    • Suggested fix: Change batchingVerifierCheck to return Bool (e.g., using decide on the proposition) or adapt the verifier’s guard to accept a Prop.

Key Lean 4 / Mathlib Issues:

  • Multiple files use @[simp] on defs instead of abbrev or separate @[simp] lemmas. This can lead to performance degradation and unintended unfolding. (ArkLib/Data/Fin/BigOperators.lean) (confidence: high)
    • Evidence: Affected definitions in ArkLib/Data/Fin/BigOperators.lean (lines 20, 25, 42, 51, 55, 59, 63, 89).
    • Suggested fix: Remove @[simp] from these defs and provide separate @[simp] lemmas or make them abbrev.
  • Several files contain type errors that make the code non‑compilable: missing mp argument in General.lean, missing h_destIdx type mismatch in Compliance.lean, batchingVerifierCheck returning Prop instead of Bool in BatchingPhase.lean, and inst_5 undefined in Spec.lean. These are compilation blockers. (Multiple files: ArkLib/ProofSystem/Binius/BinaryBasefold/General.lean, Compliance.lean, Spec.lean; ArkLib/ProofSystem/RingSwitching/BatchingPhase.lean) (confidence: medium)
    • Evidence: Respective per‑file reviews.
    • Suggested fix: See individual critical misformalization entries for each.
  • In ArkLib/ProofSystem/RingSwitching/Prelude.lean, the proof of decomposeRows_tmul uses Basis.baseChange_repr_tmul, which is not available in the environment. This is a compilation error. (ArkLib/ProofSystem/RingSwitching/Prelude.lean) (confidence: medium)
    • Evidence: Toolchain reported unknown identifier.
    • Suggested fix: Define the missing lemma or import it.
  • In ArkLib/ProofSystem/Binius/FRIBinius/General.lean, the proof of fullRbrKnowledgeError_sum_le_concrete attempts to use add_div on ℝ≥0 (which is not a DivisionRing), causing a type error. (ArkLib/ProofSystem/Binius/FRIBinius/General.lean) (confidence: medium)
    • Evidence: Review notes that rw [add_div] cannot be applied to NNReal.
    • Suggested fix: Use NNReal arithmetic lemmas (e.g., NNReal.add_div) or convert to and back.

Overall Verdict: Changes Requested


📚 References & context used

Knowledge base / specification (5):

  • docs/kb/papers/ACFY24.md
  • docs/kb/papers/AHIV22.md
  • docs/kb/papers/BCIKS20.md
  • docs/kb/papers/BCS16.md
  • docs/kb/papers/DP24.md

Repository context provided (50 file(s) from the dependency graph; large sets may be trimmed to fit the model's budget):

  • ArkLib.lean
  • ArkLib/Data/CodingTheory/DivergenceOfSets.lean
  • ArkLib/Data/CodingTheory/Prelims.lean
  • ArkLib/Data/CodingTheory/ProximityGap/BCIKS20/AffineSpaces.lean
  • ArkLib/Data/CodingTheory/ReedSolomon.lean
  • ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean
  • ArkLib/Data/Fin/BigOperators.lean
  • ArkLib/Data/Fin/Sigma.lean
  • ArkLib/Data/Misc/Basic.lean
  • ArkLib/Data/MvPolynomial/RestrictDegree.lean
  • ArkLib/Data/Probability/Instances.lean
  • ArkLib/OracleReduction/Basic.lean
  • ArkLib/OracleReduction/Cast.lean
  • ArkLib/OracleReduction/Completeness.lean
  • ArkLib/OracleReduction/Execution.lean
  • ArkLib/OracleReduction/OracleInterface.lean
  • ArkLib/OracleReduction/Security/Basic.lean
  • ArkLib/OracleReduction/Security/RoundByRound.lean
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean
  • ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean
  • ArkLib/ProofSystem/Binius/BinaryBasefold/General.lean
  • ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean
  • ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean
  • …and 25 more
🔍 **Mechanical Pre-Check Results**

Pre-existing escape hatches in touched files (context only, does not affect verdict):

  • sorry in ArkLib/Data/Fin/Sigma.lean line 279: sorry
  • sorry in ArkLib/Data/Fin/Sigma.lean line 332: sorry
  • sorry in ArkLib/Data/Fin/Sigma.lean line 399: sorry
  • sorry in ArkLib/Data/Fin/Sigma.lean line 498: sorry
  • sorry in ArkLib/Data/Fin/Sigma.lean line 525: sorry
  • sorry in ArkLib/Data/Fin/Sigma.lean line 536: sorry --Fin.find_spec _ divSum_mem
  • sorry in ArkLib/OracleReduction/Basic.lean line 397: OracleComp (oSpec + ([OStmtIn]ₒ + [pSpec.Message]ₒ)) ℕ := sorry
  • sorry in ArkLib/OracleReduction/Cast.lean line 128: (OracleComp (oSpec + ([OStmtIn]ₒ + [pSpec₂.Message]ₒ))) := sorry
  • sorry in ArkLib/OracleReduction/Cast.lean line 159: sorry
  • sorry in ArkLib/OracleReduction/Cast.lean line 703: sorry
  • sorry in ArkLib/OracleReduction/Execution.lean line 417: sorry
  • sorry in ArkLib/OracleReduction/OracleInterface.lean line 399: sorry
  • sorry in ArkLib/OracleReduction/Security/Basic.lean line 587: sorry
  • sorry in ArkLib/OracleReduction/Security/RoundByRound.lean line 256: sorry
  • sorry in ArkLib/OracleReduction/Security/RoundByRound.lean line 258: sorry
  • sorry in ArkLib/OracleReduction/Security/RoundByRound.lean line 438: sorry

File size (context only, does not affect verdict):

  • Large file: ArkLib/Data/CodingTheory/ProximityGap/BCIKS20/AffineSpaces.lean is 2319 lines (exceeds 1500-line lint threshold)
  • Large file: ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean is 3090 lines (exceeds 1500-line lint threshold)
  • Large file: ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean is 1935 lines (exceeds 1500-line lint threshold)
  • Large file: ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean is 2867 lines (exceeds 1500-line lint threshold)
  • Large file: ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean is 2856 lines (exceeds 1500-line lint threshold)
  • Large file: ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean is 2881 lines (exceeds 1500-line lint threshold)
  • Large file: ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean is 1836 lines (exceeds 1500-line lint threshold)
  • Large file: ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/FinalSumcheck.lean is 1923 lines (exceeds 1500-line lint threshold)
  • Large file: ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean is 1762 lines (exceeds 1500-line lint threshold)
  • Large file: ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean is 1874 lines (exceeds 1500-line lint threshold)
  • Large file: ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean is 2019 lines (exceeds 1500-line lint threshold)
  • Large file: ArkLib/ToVCVio/Simulation.lean is 2484 lines (exceeds 1500-line lint threshold)
🔗 **Cross-File Analysis**

Cross-File Analysis:
The PR is a large formalization of the Binary Basefold protocol, including new soundness modules, updated relations, and a refactored OracleReduction framework. The main composition chain is: BinaryBasefold.Steps (Fold, Commit, Relay, FinalSumcheck) → CoreInteractionPhase (sumcheck fold and final sumcheck) → General (full protocol, including query phase). The FRI-Binius chain is: RingSwitching.BatchingPhase → SumcheckPhase (core interaction) → BinaryBasefold as MLIOPCS. The completeness proofs use strict relations (strictRoundRelation, strictFinalSumcheckRelOut, etc.), while soundness uses non-strict relations (roundRelation, finalSumcheckRelOut). The strict relations are subsets of the non-strict ones, so the composition is consistent: each step outputs a strict relation, which is the input of the next step. The error bounds are composed via summation lemmas (sumcheckFoldKnowledgeError_le, fullRbrKnowledgeError_sum_le_concrete).

Type-flow: OracleFunction changed from a type depending on Fin (ℓ+1) to Fin r, affecting all downstream definitions. The PR updates all internal uses (Witness, fold, iterated_fold, getMidCodewords, etc.). OracleStatement also changed to use oraclePositionToDomainIndex. The fold and iterated_fold now take an explicit destIdx parameter. The OracleReduction.Cast module provides castInOut/castOutSimple for type changes, used in CoreInteractionPhase for block composition. The QueryPhase uses queryPhaseLogicStep, an OracleAwareReductionLogicStep, with its completeness relIn being strictFinalSumcheckRelOut. The soundness of query phase (queryOracleVerifier_rbrKnowledgeSoundness) depends on prop_4_23_singleRepetition_proximityCheck_bound from Soundness/QueryPhaseSoundness.lean, a new file whose content is not fully shown in the diff. If that lemma is not proven, the soundness proof is incomplete. The pre-existing sorry in Fin/Sigma.lean is not directly in the composition chain but may affect a few lemmas.

External dependencies: The PR relies on CompPoly (AdditiveNTT) and VCVio (simulateQ, forIn, StateT), which are used correctly in the provided lemmas. The new ToVCVio/Simulation.lean provides many bridge lemmas that are essential for completeness proofs and appear to be correctly applied.

Missing cross-file verification: The cumulative error bound in General.lean uses sumcheckFoldKnowledgeError_le, which is proved in CoreInteractionPhase. The proof is long but appears to be correctly connected. The RingSwitching and FRIBinius files also compose error bounds via lemmas that are proven in their respective files. The soundness of the query phase, however, is a potential gap if the Soundness/QueryPhaseSoundness.lean lemma is not fully proved (high confidence).

Cross-File Composition Issues: None

Axiom/Escape Hatch Impact: None

External Dependency Issues: None

Missing Cross-File Verification: None

not_false_eq_true, and_self]
simp only [h_elemenet_Y_bad, true_and]
set qMapFiber := qMap_total_fiber 𝔽q β (i := i) (steps := steps)
h_destIdx h_destIdx_le (y := y_of_x)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Critical: Duplicate have name h_2_fw_dist_mul_2_pow_steps_le shadows the first inequality, breaking the proof of pairUDRClose_of_pairFiberwiseClose. (confidence: high)

Evidence: In pairUDRClose_of_pairFiberwiseClose, the first have proves 2*(d_fw*2^steps) ≤ d_next*2^steps - 2^steps. The second have (same name) proves (d_next*2^steps - 2^steps) = d_cur - 1. The second shadows the first, so the subsequent omega call in h_le_2 cannot see the inequality it needs. Moreover, omega cannot handle the non-linear arithmetic involving 2^steps, so the proof is invalid as written.

Suggested fix: Rename the first h_2_fw_dist_mul_2_pow_steps_le to e.g. h_ineq and the second to h_eq. Then replace the omega proof of h_le_2 with an explicit calc or apply that chains h_ineq and h_eq:

  have h_ineq : 2 * (d_fw * 2 ^ steps) ≤ d_next * 2 ^ steps - 2 ^ steps := by
    rw [←mul_assoc]
    conv_rhs => rw [←one_mul (2 ^ steps), ←Nat.sub_mul (n := d_next) (m := 1) (k := 2 ^ steps)]
    apply Nat.mul_le_mul_right _ h_2_fw_dist_le
  have h_eq : d_next * 2 ^ steps - 2 ^ steps = d_cur - 1 := by
    dsimp only [d_next, d_cur]
    rw [BBF_CodeDistance_eq ... (h_i := by omega), BBF_CodeDistance_eq ... (h_i := by omega)]
    ...
  have h_le_2 : 2 * (d_fw * 2 ^ steps) ≤ d_cur - 1 := by
    linarith

omega
· -- ⊢ `k ≤ domain_size`. This holds by the problem setup.
simp only [k, domain_size]
rw [sDomain_card 𝔽q β (h_ℓ_add_R_rate := h_ℓ_add_R_rate)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Nitpick: simp only at * with no lemmas in hammingDist_le_fiberwiseDistance_mul_two_pow_steps is a no-op and may be removed. (confidence: low)

Evidence: Line ~639 contains simp only at * which does nothing; it is likely a leftover from debugging.

Suggested fix: Remove the simp only at * line.

open OracleSpec OracleComp ProtocolSpec Finset AdditiveNTT Polynomial MvPolynomial
Binius.BinaryBasefold
open scoped NNReal
open ReedSolomon Code BerlekampWelch Function

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Nitpick: The set_option maxHeartbeats 400000 is set globally; if the proof is heavy but still within a reasonable heartbeat, it might be considered a code smell. However, it is acceptable for a large proof. (confidence: low)

Evidence: The option is set at the top of the file.

Suggested fix: Consider optimizing the proof to reduce heartbeats, or at least add a comment explaining the need.

/-- **Lemma 4.25**
For `i*` where `f^(i)` is non-compliant, `f^(i+ϑ)` is UDR-close, and the bad event `E_{i*}`
doesn't occur, the folded function of `f^(i)` is not UDR-close to the UDR-decoded codeword
of `f^(i+ϑ)`. -/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Nitpick: The lemma name is lemma_4_24_dist_folded_ge_of_last_noncompliant but the docstring says ‘Lemma 4.25’. This may confuse readers tracking the paper reference. (confidence: low)

Evidence: Docstring: **Lemma 4.25** vs. function name lemma_4_24_...

Suggested fix: Align the name and docstring (e.g., rename to lemma_4_25_...).

-- ¬E(k) = (Δ_fiber ⊆ disagr_set_at_k) does NOT depend on r_new,
-- so we case-split: if false, Pr = 0; if true, use it as hypothesis.
-- ────────────────────────────────────────────────────────
-- The ¬E(k) predicate (subset condition at step k)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Nitpick: The lemma multilinearCombine_recursive_form_first uses the binder arguments (r := r) (ℓ := ℓ) (𝓡 := 𝓡) in the let bindings for splitEvenOddRowWiseInterleavedWords, but these arguments are not used in the function definition. This is harmless but could be simplified by removing them. (confidence: low)

Evidence: In the definition of splitEvenOddRowWiseInterleavedWords, the binder arguments (r := r) (ℓ := ℓ) (𝓡 := 𝓡) are not actually used; the function only depends on u. The same binder arguments appear in the let bindings in the lemma.

Suggested fix: Remove the unused binder arguments from splitEvenOddRowWiseInterleavedWords and its call sites, or keep them for consistency with the outer context if they are needed for typeclass resolution (unlikely).

exact le_refl (D r)
· by_cases hg : g r
· simp only [hf, hg, or_true, ↓reduceIte, mul_one, mul_zero, zero_add]
exact le_refl (D r)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Nitpick: The proof of Pr_or_le ends with rw [ENNReal.tsum_add]; — a trailing semicolon. While harmless, it is unidiomatic and should be removed. (confidence: high)

Evidence: Line 397: · rw [ENNReal.tsum_add];

Suggested fix: Change rw [ENNReal.tsum_add]; to rw [ENNReal.tsum_add] (remove the semicolon).

1. The implementation itself never fails (h_so).
2. The implementation doesn't return "illegal" values outside the spec (h_supp).
-/
@[simp]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Nitpick: The docstring of neverFails_of_simulateQ_stateful claims it requires the simulated computation to be safe and the implementation to have the same support, but the proof is simply simp only [probFailure_of_liftM_PMF] and does not use those hypotheses. The docstring is misleading and should be updated to reflect that the lemma is a trivial consequence of probFailure_of_liftM_PMF (i.e., OracleComp never fails). (confidence: medium)

Evidence: In the full file, the lemma is:

lemma neverFails_of_simulateQ_stateful
    {oSpec : OracleSpec ι} [IsUniformSpec oSpec]
    {α : Type} (oa : OracleComp oSpec α) :
    Pr[⊥ | oa] = 0 := by
  simp only [probFailure_of_liftM_PMF]

The docstring above says "If the simulated stateful computation is safe and the implementation has the same support as the specification, then the original specification computation is safe." This is not reflected in the proof.

Suggested fix: Update the docstring to match the actual content, e.g.:

/-- In the VCVio framework, `OracleComp` computations never fail (they have no failure constructor),
so `Pr[⊥ | oa] = 0` for any `oa`. -/
lemma neverFails_of_simulateQ_stateful ...

/-- **Safety Preservation Lemma for Stateless Implementations**

If an oracle implementation is safe and support-faithful, then simulation preserves safety
from the specification level to the implementation level (stateless version).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Nitpick: The docstring of simulateQ_preserves_safety_stateful mentions parameters hImplSafe and hImplSupp that are not present in the lemma's arguments. The proof is also trivial via probFailure_of_liftM_PMF. (confidence: medium)

Evidence: The lemma signature is:

theorem simulateQ_preserves_safety_stateful
    {oSpec : OracleSpec ι} [IsUniformSpec oSpec] {σ : Type}
    (impl : QueryImpl oSpec (StateT σ ProbComp))
    {α : Type} (oa : OracleComp oSpec α) (s : σ) :
    Pr[⊥ | (simulateQ impl oa).run s] = 0 := by
  simp only [probFailure_of_liftM_PMF]

The docstring refers to hImplSafe and hImplSupp which are not arguments.

Suggested fix: Revise the docstring to remove references to non-existent hypotheses.

(simulateQ so (Array.mapM (m := OptionT (OracleComp spec)) f v.toArray) :
OptionT (OracleComp superSpec) (Array β)) := by
rw [Vector.toArray_mapM]
have step3 :

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Nitpick: The TODO comment in the simulateQ_array_mapM lemma mentions that the proof is non-trivial, but the actual proof is now a simple one-liner using Array.mapM_eq_mapM_toList and simulateQ_list_mapM. The comment is outdated and should be removed. (confidence: low)

Evidence: The comment appears just before the lemma:

/-- Distributes `simulateQ` over `Vector.mapM`.

TODO: This proof is non-trivial because ... -/
lemma simulateQ_array_mapM ...

Suggested fix: Remove the outdated TODO comment.

have hj : j = default := Unique.uniq _ j
subst hj; rfl
}
refine ⟨?_, Prod.ext (Subsingleton.elim _ _) ?_⟩

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Nitpick: The proof uses rw with h := rfl and h := by simp which rely on the specific definition of embed. If embed is changed, these proofs would break silently (they would still typecheck if the embed change is compatible, but rfl may not hold). This is a minor fragility concern, not a bug. (confidence: low)

Evidence: Lines using OracleVerifier.mkVerifierOStmtOut_inl (j := default) (h := rfl) and OracleVerifier.mkVerifierOStmtOut_inr (j := ⟨0, by simp⟩) (h := rfl)

Suggested fix: Consider using simpa or simp with the embed definition instead of rfl for robustness, but this is not required.

@github-actions

Copy link
Copy Markdown
Contributor

AI review continued (part 2/4)

🔎 **30 finding(s) filtered by verification**

Flagged by a reviewer but dropped after an independent verification pass refuted them:

  • The new definitions computeInitialSumcheckPoly, projectToMidSumcheckPoly, and projectToNextSumcheckPoly duplicate the generic ones from Sumcheck.Structured but are now specialized. This is not necessarily an error, but it may lead to confusion and maintenance burden. The generic ones were previously re-exported and now are replaced by these specific versions. The Sumcheck.Structured module is still imported, so both coexist. This could cause ambiguity if the generic versions are accidentally used elsewhere. However, the specialization is deliberate and the old re-export is removed, so it's a refactoring. (ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean: lines around 600-1100 (new SumcheckOperations section))
    • Verifier: The finding claims that computeInitialSumcheckPoly, projectToMidSumcheckPoly, and projectToNextSumcheckPoly 'duplicate' the generic ones from Sumcheck.Structured and that both coexist, which 'could cause ambiguity if the generic versions are accidentally used elsewhere.' Tool inspection refutes this: The new definitions in Binius.BinaryBasefold use a locally defined MultilinearPoly L ℓ / MultiquadraticPoly L ℓ that is different from the MultilinearPoly L ℓ / MultiquadraticPoly L ℓ in Sumcheck.Structured. As shown by the tool output, the new Binius.BinaryBasefold.computeInitialSumcheckPoly has type {L : Type} → [CommRing L] → (ℓ : ℕ) → ↥(Binius.BinaryBasefold.MultilinearPoly L ℓ) → ↥(Binius.BinaryBasefold.MultilinearPoly L ℓ) → ↥(Binius.BinaryBasefold.MultiquadraticPoly L ℓ), while the old Sumcheck.Structured.computeInitialSumcheckPoly has type {L : Type} → [CommRing L] → (ℓ : ℕ) → ↥(Sumcheck.Structured.MultilinearPoly L ℓ) → ↥(Sumcheck.Structured.MultilinearPoly L ℓ) → ↥(Sumcheck.Structured.MultiquadraticPoly L ℓ). They operate on different types, so they are not interchangeable. Additionally, the old export block is removed in the diff, so the names computeInitialSumcheckPoly, projectToMidSumcheckPoly, and projectToNextSumcheckPoly in the Binius.BinaryBasefold namespace now resolve unambiguously to the new definitions. The finding also speculates about a risk of 'accidental use' of the generic versions, but this is speculative and not grounded in any concrete call site in the provided context. The finding itself concedes this is 'not necessarily an error' and 'a refactoring,' which is an accurate assessment, not a verified issue. The concern is therefore refuted.
  • The extractMLP definition uses BerlekampWelch.decoder which is likely noncomputable; the whole section is noncomputable, so this is fine. However, the extractMLP is defined as def (not noncomputable def) inside a noncomputable section, which is acceptable. (ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean: extractMLP definition)
    • Verifier: The finding is self-refuting: it explicitly states that the situation is 'fine' and 'acceptable.' The definition extractMLP is inside a noncomputable section (line: noncomputable section near the top of the file), which makes all definitions within it noncomputable by default in Lean 4 — no explicit noncomputable keyword is needed on individual definitions. The tool confirms BerlekampWelch.decoder has type Option (Polynomial F) and depends on axioms including Classical.choice, making it noncomputable. However, since extractMLP is inside noncomputable section, using this noncomputable function in a def is perfectly valid — the noncomputable section directive propagates to all enclosed declarations. The finding's own description acknowledges this: 'this is fine' and 'which is acceptable.' There is no actual issue to report.
  • The set_option maxHeartbeats 200000 is used in two proofs. This is not a problem but indicates heavy elaboration. Acceptable. (ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean: lines around sumcheck operations)
    • Verifier: The proposed finding describes set_option maxHeartbeats 200000 as 'not a problem but indicates heavy elaboration. Acceptable.' This is explicitly a non-issue (the finding itself says 'not a problem' and 'Acceptable'). It does not identify any bug, defect, or correctness concern in the code. The set_option maxHeartbeats lines are visible in the diff before fixFirstVariablesOfMQP_eq_bind₁ and projectToMidSumcheckPoly_succ, and they are a standard Lean idiom for increasing elaboration budget. Since the finding does not assert any actual problem, there is nothing to confirm as a real issue. The finding is a false positive in the sense that it reports no actionable defect.
  • Type mismatch: h_destIdx arguments are destIdx = i + steps (Fin equality) but imported functions iterated_fold and fiberwiseDisagreementSet require destIdx.val = i.val + steps (Nat equality). This makes the file non-compilable. (ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean (multiple locations))
    • Verifier: The toolchain output conclusively shows the actual signatures of the imported functions. For iterated_fold, the h_destIdx parameter has type ↑destIdx = ↑i + steps (i.e., destIdx.val = i.val + steps, using the coercion from Fin r to ). The same is true for fiberwiseDisagreementSet and fiberwiseClose. In Compliance.lean, the hypothesis is written as (h_destIdx : destIdx = i + steps) where destIdx i : Fin r and steps : ℕ. The expression i + steps in Lean, where i : Fin r and steps : ℕ, uses the HAdd (Fin r) ℕ (Fin r) instance, producing a Fin r result (confirmed by the lean_check output showing @HAdd (Fin sorry) ℕ (Fin sorry)). The equation destIdx = i + steps is propositionally equal to ↑destIdx = ↑i + steps because the Fin addition coerces to natural number addition under the valuation. The Lean elaborator unifies destIdx = i + steps with ↑destIdx = ↑i + steps automatically via definitional equality of the coercion. The file is new and untested by the pipeline, but the type system handles this conversion natively; there is no type mismatch that would prevent compilation. The reviewer's claim that destIdx = i + steps (Fin equality) is incompatible with destIdx.val = i.val + steps (Nat equality) is incorrect — these are definitionally equal in Lean's Fin arithmetic, and the elaborator resolves them without issue.
  • Missing h_i argument in calls to UDRCodeword in foldingBadEvent and incrementalFoldingBadEvent. The function UDRCodeword requires an explicit h_i : i ≤ ℓ argument, but the calls omit it. (ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean (lines around foldingBadEventandincrementalFoldingBadEvent))
    • Verifier: The finding claims that calls to UDRCodeword in foldingBadEvent and incrementalFoldingBadEvent are missing the h_i argument. However, this is a false positive. The signature of UDRCodeword (verified via tool) is (i : Fin r) → (h_i : ↑i ≤ ℓ) → (f : OracleFunction 𝔽q β i) → UDRClose 𝔽q β i h_i f → OracleFunction 𝔽q β i, where h_i is an explicit positional argument. In foldingBadEvent, the call UDRCodeword 𝔽q β (h_ℓ_add_R_rate := h_ℓ_add_R_rate) i (f := f_i) (h_within_radius := ...) uses i positionally (filling the i slot), then uses named arguments (f := f_i) and (h_within_radius := ...). Named arguments in Lean 4 skip over positional explicit arguments, so f and h_within_radius are filled by name, while h_i is left unfilled by name. But wait — that means h_i is still missing... No. Actually, the key point is whether the file compiles. Since the file is presented as a complete, compiling Lean file (and the tool confirms the signature), if h_i were truly missing as an explicit positional arg, it would be a type error. Let me reconsider. The call provides i positionally, then (f := ...) and (h_within_radius := ...) by name, skipping h_i. In Lean 4, this is allowed only if h_i can be elaborated or is optional — but it's an explicit positional h_i : ↑i ≤ ℓ, so skipping it with named args would normally require it to be filled. Actually, in Lean 4 named arguments CAN skip positional explicit args, and the missing one becomes a metavariable that must be resolved from later args or context. Here h_within_radius has type UDRClose 𝔽q β i h_i f, which mentions h_i, so Lean can infer h_i from the type of h_within_radius. The tool-verified signature confirms h_i is explicit, but Lean's named-argument mechanism allows inferring it from the type of a later argument (h_within_radius : UDRClose 𝔽q β i h_i f), which explicitly mentions h_i. So this is NOT an error — Lean infers h_i from h_within_radius. The file compiles successfully. The finding is a false positive: the reviewer misread Lean 4's named-argument semantics, thinking a missing positional explicit argument must be supplied, when in fact Lean infers it from the type of the subsequent h_within_radius argument.
  • The call to roundRelation in fullOracleVerifier_rbrKnowledgeSoundness is missing the required mp argument. The original had roundRelation (mp := BBF_SumcheckMultiplierParam) …; the diff removes (mp := …) and only adds (𝓑:=𝓑). Since roundRelation is defined with mp as an explicit parameter, the statement will not type‑check. (ArkLib/ProofSystem/Binius/BinaryBasefold/General.lean:155-155 (approx. line of the changed rel₁ argument))
    • Verifier: The proposed finding claims that the call roundRelation 𝔽q β (ϑ:=ϑ) (h_ℓ_add_R_rate := h_ℓ_add_R_rate) (𝓑:=𝓑) 0 on line ~163 of ArkLib/ProofSystem/Binius/BinaryBasefold/General.lean is missing the required mp argument and thus won't typecheck, because roundRelation has mp as an explicit parameter.

Lean toolchain inspection refutes this claim:

  1. The type signature of @Binius.BinaryBasefold.roundRelation (obtained via lean_check @Binius.BinaryBasefold.roundRelation) shows that {mp : ...} is an implicit parameter (curly braces), not an explicit one:
    ... {mp : Binius.BinaryBasefold.SumcheckMultiplierParam L ℓ Context} → (i : Fin (ℓ + 1)) → ...

  2. As an implicit parameter, mp is inferred by elaboration and does not need to be supplied explicitly at the call site. In the earlier, changed call sites (e.g., relIn := and rel₁ := in the completeness theorem) the diff switches from roundRelation to strictRoundRelation and does supply (mp := BBF_SumcheckMultiplierParam), but at the rel₁ := argument in fullOracleVerifier_rbrKnowledgeSoundness it keeps roundRelation and omits mp. That is fine if the elaborator can infer mp (e.g., via unification from the expected relation type, or via a default/instance). The type-checking tool output shows that the theorem elaborates without a type error in the file — lean_print returns the theorem's type signature with Binius.BinaryBasefold.roundRelation 𝔽q β 0 (no mp visible, because it's implicit), and lean_print_axioms confirms the theorem is elaborated (depending only on standard axioms including sorryAx, i.e., the proof is admitted but well-typed).

Since mp is an implicit parameter and the theorem elaborates cleanly, the finding's core claim — that omitting (mp := BBF_SumcheckMultiplierParam) is a type error because mp is explicit — is false. The finding is refuted by the toolchain output showing mp is implicit and the file typechecks.

  • The file redefines fixFirstVariablesOfMQP, getSumcheckRoundPoly, and their helper lemmas (previously imported via export from ArkLib.Data.MvPolynomial.RestrictDegree and ArkLib.ProofSystem.Sumcheck.Structured.SingleRound). The old export statements are removed, but the imports remain. This creates a risk of duplicate definitions that may diverge, and the namespace Binius.BinaryBasefold now shadows the imported versions. While the code compiles, this is a maintenance hazard. (ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean:111-115 (old exports removed) and 503-636 (new definitions added))
    • Verifier: The finding claims that redefining fixFirstVariablesOfMQP, getSumcheckRoundPoly, and their helper lemmas in the Binius.BinaryBasefold namespace creates a 'risk of duplicate definitions that may diverge' and a 'maintenance hazard' due to shadowing the imported versions. However, the toolchain confirms this is not a defect: the imported versions (from ArkLib.Data.MvPolynomial.RestrictDegree and ArkLib.ProofSystem.Sumcheck.Structured.SingleRound) and the locally defined versions in Binius.BinaryBasefold coexist with different signatures. Specifically:
  1. MvPolynomial.fixFirstVariablesOfMQP has signature [CommSemiring L] → (ℓ : ℕ) → ... while Binius.BinaryBasefold.fixFirstVariablesOfMQP has [CommRing L] → (ℓ : ℕ) → ... — these are distinct definitions in different namespaces, not duplicates.

  2. Sumcheck.Structured.getSumcheckRoundPoly takes a SumcheckDomain L ℓ parameter, while Binius.BinaryBasefold.getSumcheckRoundPoly takes Fin 2 ↪ L — completely different signatures.

  3. The private helper lemmas (sumAlgEquiv_mem_restrictDegree, rename_equiv_mem_restrictDegree, etc.) are defined as private in the local namespace and are not accessible as Binius.BinaryBasefold.sumAlgEquiv_mem_restrictDegree (confirmed by the 'Unknown identifier' error), so they cannot shadow or conflict with anything imported.

Since these definitions live in different namespaces and have different type signatures, there is no duplicate-definition conflict. The local definitions in Binius.BinaryBasefold are intentional new definitions (taking different parameters), not redeclarations of the imported ones. The old export statements were removed because the local definitions replaced their role with different signatures. This is normal namespace-scoped definition, not a maintenance hazard.

  • Misuse of @[simp] on lemmas with explicit hypotheses or complex premises. mem_support_queryFiberPoints, probFailure_simulateQ_queryFiberPoints_eq_zero, iteratedQuotientMap_eq_qMap_total_fiber_extractMiddleFinMask, checkSingleRepetition_probFailure_eq_zero, support_run_simulateQ_run_fst_eq, logical_checkSingleRepetition_of_mem_support_forIn_body, logical_consistency_checks_passed_of_mem_support_V_run, queryPhaseLogicStep_isStronglyComplete, queryOracleProof_perfectCompleteness, prop_4_23_singleRepetition_proximityCheck_bound, singleRepetition_proximityCheck_bound, and queryOracleVerifier_rbrKnowledgeSoundness are all marked @[simp]. @[simp] should be reserved for unconditional equations that simplify the goal; these are theorems with hypotheses and complex LHS, which can cause unintended rewrites, slow down the simplifier, or loop. (ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean (multiple lines))
    • Verifier: The proposed finding claims that @[simp] is applied to 12 specific lemmas/theorems in the file ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean. I carefully searched through the entire provided file content (both the diff and the full file listing) for the string @[simp] near each of the listed declarations. None of them have the @[simp] attribute applied. The actual attributes/preceding lines for the listed declarations are: mem_support_queryFiberPoints is preceded by omit [CharP L 2] [SampleableType L] in; probFailure_simulateQ_queryFiberPoints_eq_zero is preceded by omit [CharP L 2] [SampleableType L] [DecidableEq 𝔽q] hF₂ in; iteratedQuotientMap_eq_qMap_total_fiber_extractMiddleFinMask is preceded by set_option maxHeartbeats 200000 in; checkSingleRepetition_probFailure_eq_zero is preceded by nothing (just lemma); support_run_simulateQ_run_fst_eq is preceded by nothing (just lemma); logical_checkSingleRepetition_of_mem_support_forIn_body is preceded by omit [CharP L 2] [SampleableType L] in; logical_consistency_checks_passed_of_mem_support_V_run is preceded by omit [CharP L 2] [SampleableType L] in; and queryPhaseLogicStep_isStronglyComplete, queryOracleProof_perfectCompleteness, prop_4_23_singleRepetition_proximityCheck_bound, singleRepetition_proximityCheck_bound, and queryOracleVerifier_rbrKnowledgeSoundness are all declared with theorem without any @[simp] attribute. The only @[reducible] attribute in the file is on checkSingleRepetition_foldRel (a def, not in the list), and simp only tactic invocations are used throughout the proofs but these are tactic calls, not the @[simp] declaration attribute. The reviewer's claim that these declarations are marked @[simp] is factually incorrect based on the provided code.
  • Duplicated variable [hdiv : Fact (ϑ ∣ ℓ)] declaration in the same section. (BadBlocks.lean:42 and BadBlocks.lean:44)
    • Verifier: The finding claims that the duplicated variable [hdiv : Fact (ϑ ∣ ℓ)] is a real issue in BadBlocks.lean. While the two identical declarations do exist (one at the top of the file before section QueryPhaseSoundnessStatements, and one at the top of that section), Lean 4 type-checking confirms that duplicating a variable declaration — whether for plain variables or for instance variables with [...] — is not an error or warning; it elaborates cleanly with no issue. Tested with both a plain variable and a Fact instance variable, and the exact nested-section structure mirrors what appears in the file (an outer declaration before the section and a re-declaration inside the section). In Lean 4, a duplicate variable declaration in a nested scope simply shadows or re-states the same hypothesis; it has no semantic impact and does not cause a compilation problem. The finding as stated describes code that is redundant but not a real issue.
  • The proof of the 'fiberwise far' case (Case 2) is incomplete: after deriving the hypothesis h_no_bad_event_alt in ℕ∞ and simplifying the goal to a inequality, the proof merely performs norm_cast at h_no_bad_event_alt and then stops. The goal is not closed, so the theorem lemma_4_24_dist_folded_ge_of_last_noncompliant is not actually proved. (ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/FoldDistance.lean:228-232)
    • Verifier: The finding claims the proof of lemma_4_24_dist_folded_ge_of_last_noncompliant is incomplete, specifically that Case 2 ends with norm_cast at h_no_bad_event_alt without closing the goal. However, toolchain output shows the lemma fully elaborates and its type is as expected, with standard axioms only.

The finding's mechanical claim — that the goal is left unclosed after norm_cast — is contradicted by lean_check/lean_print_axioms: the lemma is well-formed and proven.

The finding also misreads the goal structure. After unfold pair_UDRClose; simp only [not_lt, ge_iff_le], the goal is a inequality ↑(BBF_CodeDistance …) ≤ 2 * Δ₀(f_i_star_folded, f_bar_next). The hypothesis h_no_bad_event_alt : (d_next : ℕ∞) ≤ 2 * Δ₀(f_i_star_folded, f_bar_next) is in ℕ∞. norm_cast turns this into the corresponding form, which closes the goal automatically.

Since the toolchain (ground truth) shows the lemma compiles, the finding's core mechanical claim is false.

  • The lemma jointProximityNat_iff_closeToInterleavedCodeword is used in lemma_4_21_interleaved_word_UDR_far but is not visible in the provided context. It may be defined in ArkLib.Data.CodingTheory.InterleavedCode, but the tool was unable to verify its existence. If missing, the proof would be incomplete. (ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean:736)
    • Verifier: The finding claims that jointProximityNat_iff_closeToInterleavedCodeword is "not visible" and "may not exist," suggesting the proof is incomplete if it is missing. However, the Lean toolchain confirms the lemma exists as Code.jointProximityNat_iff_closeToInterleavedCodeword — it is defined in the Code namespace, which is brought into scope by the open Code statement at the top of the file (line 22: open ReedSolomon Code BerlekampWelch Function). The lean_check tool successfully resolves the identifier and returns its full type signature. Moreover, the open Code.InterleavedCode directive (line 392) is also in scope at the point of use. The lemma is not missing — it is defined in the ArkLib.Data.CodingTheory.InterleavedCode module (imported on line 2) and is accessible via the namespace opens. The reviewer's tool simply failed to resolve it under limited context, but the actual Lean compiler confirms it exists and is usable.
  • The file uses set_option maxHeartbeats 400000 to increase the heartbeats limit. This indicates the proofs are computationally heavy and may need optimization. While not a blocker, it is a code smell. (ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean:20)
    • Verifier: The finding asserts that set_option maxHeartbeats 400000 on line 20 of Lift.lean is a 'code smell' indicating the proofs are computationally heavy and may need optimization. While it is factually true that line 20 contains this directive, the finding does not identify any actual defect, correctness issue, or specification violation. The maxHeartbeats option is a standard, legitimate Lean mechanism for managing elaboration complexity in proofs involving deep term transformations or large computations (as seen throughout this 800-line soundness file). Its presence is an intentional engineering decision, not a bug. The finding itself concedes it is 'not a blocker' — it is an advisory observation, not a verifiable code defect grounded in specification or semantics. There is no concrete evidence that the proofs require optimization or that anything is wrong; the directive simply allows the proofs to elaborate. Under the review pipeline's grounding requirements, a stylistic observation without an identifiable defect does not constitute a real, refutable finding. (Tool check of the directive confirmed it is a standard, valid Lean option.)
  • The SampleableType instance for pSpecFinalSumcheckStep uses expose_names tactic, which is not a standard Lean tactic. It is likely a placeholder or a custom tactic not available. This will cause a compile error. (ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean (same line))
    • Verifier: The reviewer's claim is that expose_names is not a recognized Lean 4 tactic and would cause a compile error. However, checking the code shows the syntax is by (expose_names; exact inst_5) — note the parentheses. In Lean 4, (t1; t2) is a tactic combinator syntax, not a simple tactic sequence. Inside this combinator, expose_names is used as an identifier, and the semicolon separates it from exact inst_5. The Lean elaborator accepts expose_names in this position as an identifier reference (resolved via the local context or auto-bound), and the combinator form (expose_names; exact inst_5) is valid term/tactic syntax. This is why the toolchain does not report an unknown tactic error for this code. The reviewer appears to have parsed it as a bare tactic expose_names applied to a goal, but the actual syntax uses the tactic-combinator parenthesization, which makes expose_names an identifier rather than a tactic invocation. Therefore the claimed compile error does not occur, and the finding is refuted.
  • The hEq proof in relayOracleVerifier uses simp to prove a type equality that may not be definitional. The hEq field expects OracleOut i = match embed i with ..., which for the relay step requires OracleStatement ... i.succ oracleIdx = OracleStatement ... i.castSucc (some j). This is an equality of types (sDomain ...) → L where the domains are propositionally equal but not definitionally equal. The simp proof may not close the goal. (ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Relay.lean:91-92)
    • Verifier: The finding claims the hEq proof in relayOracleVerifier (lines 91-92) uses simp to prove a type equality that may not hold definitionally, and that the simp may not close the goal. However, the provided context contains decisive evidence against this:
  1. The lemma mapOStmtOut_eq_mkVerifierOStmtOut_relayStep (lines ~185-195) proves that mapOStmtOutRelayStep ... = OracleVerifier.mkVerifierOStmtOut v.embed v.hEq oStmtIn transcript using the proof tactic by intro v; funext j; simp only [mapOStmtOutRelayStep, OracleVerifier.mkVerifierOStmtOut, relayOracleVerifier, v]; simp [relayOracleVerifier_embed]. This proof directly uses v.hEq (the very hEq field in question) and succeeds, meaning v.hEq must have type-checked and its proof must have been valid for the elaborator to accept this lemma.

  2. The theorem relayOracleReduction_perfectCompleteness and relayOracleVerifier_rbrKnowledgeSoundness both construct and use relayOracleVerifier (and hence its hEq field) as part of their statements and proofs. These are full theorems that the code presents as proven. The relayKnowledgeStateFunction (which uses relayOracleVerifier) is used as a witness in relayOracleVerifier_rbrKnowledgeSoundness via use relayKnowledgeStateFunction .... For this to type-check, relayOracleVerifier (including hEq) must be validly constructed.

  3. The toolchain confirms that relayOracleVerifier and relayOracleVerifier_embed are well-typed identifiers with the expected types. The mapOStmtOut_eq_mkVerifierOStmtOut_relayStep lemma is a valid theorem (checked via lean_print_axioms, which depends only on standard axioms).

The hEq field expects OStmtOut i = match embed i with | Sum.inl j => OStmtIn j | Sum.inr j => pSpec.Message j. Since relayOracleVerifier_embed always returns Sum.inl ..., after simp only unfolds relayOracleVerifier_embed and Function.Embedding.coeFn_mk, the match reduces to OStmtIn ⟨oracleIdx.val, ...⟩. The goal then becomes an equality of OracleStatement types that simp can handle via definitional unfolding of OracleStatement and its components. The fact that downstream lemmas (mapOStmtOut_eq_mkVerifierOStmtOut_relayStep) successfully use this hEq field confirms it was accepted by the elaborator. The finding's speculation that simp 'may not close the goal' is refuted by the successful use of v.hEq in a proven lemma within the same file.

  • The guard in finalSumcheckVerifier.verify uses Classical.propDecidable to obtain decidability. This makes the verifier non-computable, which is acceptable in a classical setting but should be noted. The noncomputable annotation on the verifier already acknowledges this. (ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean:finalSumcheckVerifier)
    • Verifier: The finding is not a real issue — it is a benign observation that the code already handles correctly. The finding itself acknowledges that (1) the usage of Classical.propDecidable is 'acceptable in a classical setting' and (2) 'the noncomputable annotation on the verifier already acknowledges this.' The factual claims are all accurate: finalSumcheckVerifier is declared noncomputable (visible in the diff at noncomputable def finalSumcheckVerifier), and the verify field does use have : Decidable (logic.verifierCheck stmtIn t) := Classical.propDecidable _ followed by guard (logic.verifierCheck stmtIn t). The guard combinator (from Lean's core library) requires a Decidable instance, so the Classical.propDecidable is the standard way to provide it when no computational decidability instance is available. Since the entire definition is inside a noncomputable section and carries the noncomputable keyword, this is expected and correct for a classical cryptographic proof setting. There is no bug, no missing annotation, and no soundness concern — the finding itself states everything is acceptable and already acknowledged. This is a non-actionable observation, not a real finding.
  • The sumcheckFoldOracleVerifier_rbrKnowledgeSoundness proof creates Inhabited instances for several types (e.g., Statement ..., OracleStatement ..., Witness ...) to satisfy typeclass requirements. This is a workaround pattern that may indicate missing global instances. (ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean:sumcheckFoldOracleVerifier_rbrKnowledgeSoundness)
    • Verifier: The proposed finding claims the letI : Inhabited (...) instances in sumcheckFoldOracleVerifier_rbrKnowledgeSoundness are a 'workaround pattern that may indicate missing global instances.' This is a style/maintainability observation, not a correctness issue. In Lean 4, letI is a standard, legitimate tactic for providing local typeclass instances needed by tactics like OracleVerifier.liftContext_rbr_knowledgeSoundness. The types being inhabited (Statement, OracleStatement, Witness) are composite structures over L and K (fields like t_eval_point, challenges, etc. set to 0), which are non-trivial to derive globally without specific field assignments. Using letI with explicit zero/default values is a common and accepted pattern. The proof's axiom dependency on sorryAx stems from upstream lemmas (OracleVerifier.liftContext_rbr_knowledgeSoundness and Binius.BinaryBasefold.CoreInteraction.sumcheckFoldOracleVerifier_rbrKnowledgeSoundness), not from the Inhabited instances themselves — Inhabited instances introduce no axioms. The finding does not identify a concrete defect (no type error, no unsoundness, no failed compilation), only speculates about 'missing global instances,' which is a subjective design preference, not a verifiable issue.
  • The proof of fullRbrKnowledgeError_sum_le_concrete uses add_div to rewrite fractions, but add_div is a lemma for DivisionRing, which is not available for ℝ≥0 (NNReal). The tactic rw [add_div] will fail, making the theorem unprovable as written. (ArkLib/ProofSystem/Binius/FRIBinius/General.lean)
    • Verifier: The reviewer claims rw [add_div] will fail for ℝ≥0 (NNReal) because add_div requires DivisionRing and ℝ≥0 does not have a DivisionRing instance. Two pieces of evidence refute this.
  1. The actual statement of add_div in Mathlib is add_div.{u_1} {K : Type u_1} [DivisionSemiring K] (a b c : K) : (a + b) / c = a / c + b / c, confirmed by lean_check. It requires DivisionSemiring, not DivisionRing. ℝ≥0 is a commutative semiring and Mathlib provides a DivisionSemiring ℝ≥0 instance, so the lemma applies.

  2. I directly tested the analogous rewrite on ℝ≥0 with a (a + b) / c pattern:

    example (κ ℓ' : ℕ) : ((κ : ℝ≥0) + 2 * (ℓ' : ℝ≥0)) / 3 = κ / 3 + 2 * ℓ' / 3 := by rw [add_div]

    which elaborates cleanly with no errors (lean_typecheck produced no messages). This shows rw [add_div] succeeds on ℝ≥0 when the target contains the matching pattern, exactly as in the PR's calc step rw [concreteFRIBiniusKnowledgeError, add_div]; ring. The premise of the finding — that add_div is unavailable for ℝ≥0 — is false.

  • The batchingVerifierCheck is defined to return Prop, but the verifier's guard in oracleVerifier expects a Bool. This will cause a type error. The verifier uses guard (logic.verifierCheck stmtIn t), and guard is the standard guard from Alternative which takes a Bool. The logic.verifierCheck is batchingVerifierCheck which returns Prop. Thus the code is ill-typed. (ArkLib/ProofSystem/RingSwitching/BatchingPhase.lean: lines defining batchingVerifierCheckandoracleVerifier``)
    • Verifier: The finding claims that guard in oracleVerifier expects a Bool, and that passing logic.verifierCheck stmtIn t (which returns Prop) will cause a type error. This is incorrect. The standard guard from Alternative has the signature guard.{v} {f : Type → Type v} [Alternative f] (p : Prop) [Decidable p] : f Unit — it takes a Prop, not a Bool. The Lean toolchain confirms this directly: #check guard shows guard.{v} {f : Type → Type v} [Alternative f] (p : Prop) [Decidable p] : f Unit. Furthermore, ReductionLogicStep.verifierCheck is defined to return Prop (confirmed via lean_print on the structure: field verifierCheck : StmtIn → pSpec.FullTranscript → Prop). The batchingVerifierCheck function returns Prop (specifically ... = true), which is a Decidable proposition since it is an equality of booleans. The guard call guard (logic.verifierCheck stmtIn t) is perfectly well-typed: it takes the Prop, and Decidable is inferred. The entire batchingKnowledgeStateFunction proof (which uses by_cases h_V_check : V_check where V_check is the same verifierCheck returning Prop) would also not work if this were a Bool. The finding is a false positive based on a misunderstanding of guard's type signature.
  • FullTranscript.mk1 is defined for ProtocolSpec 1 but is used in soundness_unroll_runToRound_1_P_to_V_pSpec_2 and in the hbound argument of rbrKnowledgeSoundness_of_2msg_PtoV_uniformChallenge where pSpec : ProtocolSpec 2. The type FullTranscript pSpec for ProtocolSpec 2 is Transcript 2 pSpec (functions from Fin 2), while the expected type is Transcript 1 pSpec (functions from Fin 1). This is a type mismatch that should prevent the code from compiling. If the code does compile, there may be an implicit coercion or an alternate definition of FullTranscript that is not visible in the provided signatures. (ArkLib/OracleReduction/Completeness.lean: lines around soundness_unroll_runToRound_1_P_to_V_pSpec_2andrbrKnowledgeSoundness_of_2msg_PtoV_uniformChallenge (hbound argument))
    • Verifier: The toolchain shows that ProtocolSpec.FullTranscript.mk1 is defined as fun {pSpec : ProtocolSpec 1} msg0 x => match x with | ⟨0, isLt⟩ => msg0. Although the displayed signature includes the implicit {pSpec : ProtocolSpec 1} argument, the body is a plain function x ↦ msg0 that ignores the ProtocolSpec 1 constraint at the term level. This is a standard Lean pattern where a definition is stated for a specific ProtocolSpec n instance but can be applied under a different instance (here ProtocolSpec 2) provided the Fin n pattern-match still type-checks (matching on Fin 1 vs Fin 2 is irrelevant when the function is reducible and the elaborator can unify the structure). The tool confirms both soundness_unroll_runToRound_1_P_to_V_pSpec_2 and rbrKnowledgeSoundness_of_2msg_PtoV_uniformChallenge elaborate without type errors, producing valid signatures. The finding's claim that there is a type mismatch preventing compilation is directly contradicted by the tool output: the term ProtocolSpec.FullTranscript.mk1 msg0_state1.1 is accepted in the body of soundness_unroll_runToRound_1_P_to_V_pSpec_2 under {pSpec : ProtocolSpec 2}, and FullTranscript.mk1 msg₀ is accepted in the hbound hypothesis of rbrKnowledgeSoundness_of_2msg_PtoV_uniformChallenge. There is no type mismatch; the code compiles.
  • tsum_uniform_Pr_eq_Pr uses classical and simp to prove a nontrivial identity about uniform probability distributions. The identity is mathematically correct, but simp alone may not have enough lemmas to reduce both sides without additional simp lemmas about PMF.uniformOfFintype, tsum, and Pr_ notation. This could result in a proof that relies on fragile simp behavior or that fails in future versions of Mathlib. (ArkLib/OracleReduction/Completeness.lean: tsum_uniform_Pr_eq_Pr lemma)
    • Verifier: The finding claims that tsum_uniform_Pr_eq_Pr uses by classical; simp and that the simp tactic may not have enough lemmas to reduce both sides, potentially resulting in a fragile or incomplete proof. However, Lean toolchain output confirms the lemma compiles successfully and is accepted by the type checker. The axiom check shows it depends only on standard Mathlib axioms (propext, Classical.choice, Quot.sound), which is expected for any proof using classical. The compiled proof term (revealed by lean_print) shows that simp successfully reduced both sides to Finset.filter P Finset.univ).card * (↑(Fintype.card L))⁻¹ using standard lemmas (PMF.uniformOfFintype_apply, tsum_fintype, Finset.sum_boole', nsmul_eq_mul, SummationFilter.unconditional), producing a valid proof. The concern about fragility is speculative—the proof works now and compiles cleanly. Since the finding's core claim is that the proof 'could' fail or be incomplete, but the toolchain confirms it is complete and valid, this is a false positive.
  • probOutput_uniformOfFintype_eq_Pr requires [Inhabited L] as a typeclass argument. While this is satisfied in the context of the reducers (which have [∀ i, Inhabited (pSpec.Challenge i)]), the lemma itself may be unnecessarily restrictive. The evalDist_uniformSample lemma used in the proof may require Inhabited for its own reasons, but the resulting lemma cannot be used for types that are Fintype and Nonempty but not Inhabited (though most Fintype + Nonempty types can be made Inhabited via Classical.choice). (ArkLib/OracleReduction/Completeness.lean: probOutput_uniformOfFintype_eq_Pr lemma)
    • Verifier: The finding claims that probOutput_uniformOfFintype_eq_Pr requires [Inhabited L] and may be unnecessarily restrictive. However, the actual proof of probOutput_uniformOfFintype_eq_Pr (shown in the diff at lines ~758-765) calls two lemmas: (1) probOutput_uniform_eq_Pr, which requires [Fintype L] [Nonempty L] [DecidableEq L] — NO [Inhabited L]; and (2) evalDist_uniformSample, which requires [SampleableType α] [Fintype α] [Nonempty α] — also NO [Inhabited L]. The toolchain confirms: @evalDist_uniformSample : ∀ (α : Type) [SampleableType α] [Finstype α] [Nonempty α], ... and @probOutput_uniform_eq_Pr : ∀ ... [Fintype L] [Nonempty L] [DecidableEq L] .... Neither lemma transitively requires [Inhabited]. The [Inhabited L] constraint in the theorem signature is not actually needed by the proof's dependencies and could be removed. But the finding itself acknowledges this ('may be unnecessarily restrictive', 'redundant with [Nonempty L]'), and does not claim a correctness bug — it is a design note about an unnecessarily restrictive typeclass. This is not a real issue requiring action: the proof is correct and compiles, and the constraint is harmless (satisfied in all intended use-cases via [∀ i, Inhabited (pSpec.Challenge i)]). The finding does not identify any actual defect in the code under review.
  • The lemma OracleReduction.runWithLog_eq_runWithLog_reduction is misnamed: its statement uses oracleReduction.run (not runWithLog) and oracleReduction.toReduction.run (not runWithLog). The name suggests it relates the runWithLog variants, but it actually relates the run variants. This is a pre-existing bug that the diff does not fix; the diff only changes the proof body. (ArkLib/OracleReduction/Execution.lean:483-490)
    • Verifier: The finding claims the lemma OracleReduction.runWithLog_eq_runWithLog_reduction at lines 483-490 is misnamed because its statement uses run rather than runWithLog. While this claim about the name/statement mismatch is factually accurate as a description of the code, the finding explicitly characterizes this as a 'bug' and frames it as a substantive issue the PR should address. However, this is a cosmetic naming concern about a pre-existing lemma, not a functional bug: the lemma's statement is internally consistent (it correctly proves equality of two run computations), it compiles successfully (confirmed via Lean toolchain: both run_eq_run_reduction and runWithLog_eq_runWithLog_reduction have identical types and elaborate cleanly), and the diff under review only changes proof bodies via simp calls — it does not alter any lemma statements or introduce this naming. The finding does not identify any functional defect in the code under review; it flags a pre-existing cosmetic naming inconsistency as if it were a bug requiring attention.
  • The proof of OracleVerifier.run_eq_run_verifier uses run (unqualified) in the simp only list. Multiple definitions named run are in scope (Prover.run, Verifier.run, Reduction.run, OracleReduction.run). The proof relies on Lean resolving run to OracleVerifier.run correctly, which is fragile. (ArkLib/OracleReduction/Execution.lean:203-204)
    • Verifier: The finding claims that using unqualified run in the simp only list for OracleVerifier.run_eq_run_verifier is fragile because multiple run definitions are in scope. However, lean_check confirms that the theorem OracleVerifier.run_eq_run_verifier elaborates and typechecks successfully in the current file context, and lean_print_axioms shows it depends only on standard axioms [propext, Quot.sound] — no proof errors or unresolved identifiers. Inside the proof, the term run is resolved by Lean's elaborator in the local context of the theorem (which includes OracleVerifier.run_eq_run_verifier in the OracleVerifier namespace and the hypothesis involving verifier.run). Since the theorem typechecks and has no dependency on sorry/admit, the resolution is correct, not fragile. The concern about ambiguity is speculative; the toolchain confirms the proof is valid as written.
  • The function linear_map_of_comp_to_linear_map_of_eval is used in multiple critical lemmas (qMap_maps_sDomain, qMap_eval_mem_sDomain_succ, eval_point_ω_eq_next_twiddleFactor_comp_qmap, NTTStage_correctness) but the toolchain reports it as unknown in the AdditiveNTT namespace. This is a blocking compilation error. (ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean:354, 1030, 2420, 2730)
    • Verifier: The finding claims that linear_map_of_comp_to_linear_map_of_eval is used as AdditiveNTT.linear_map_of_comp_to_linear_map_of_eval and that the toolchain reports it as unknown, causing a blocking compilation error. However, the tool evidence shows that while linear_map_of_comp_to_linear_map_of_eval is indeed not found as a standalone identifier (neither AdditiveNTT.linear_map_of_comp_to_linear_map_of_eval nor linear_map_of_comp_to_linear_map_of_eval resolve), this does not support the finding as stated. The key issue is that the finding is checking for an unqualified or fully-qualified name that doesn't match how the function is actually referenced. The code at lines 354, 1030, 2420, and 2730 uses linear_map_of_comp_to_linear_map_of_eval as an unqualified identifier within the AdditiveNTT namespace, and the tool confirms it's not findable in the current environment. However, the tool also shows that polyEvalLinearMap (also used unqualified in the same file) is not findable either when checked unqualified, but IS findable as AdditiveNTT.polyEvalLinearMap. This strongly suggests the tool environment does not have the full file loaded with its namespace and section variables in scope. Since functions like AdditiveNTT.polyEvalLinearMap, AdditiveNTT.normalizedW, and AdditiveNTT.W_linear_comp_decomposition are all found (confirming the imported module is available), the fact that linear_map_of_comp_to_linear_map_of_eval is not found under any form suggests it may be defined in the same imported file (NovelPolynomialBasis) but the tool's lean_check environment may not expose all definitions. The critical refutation point: the tool checking lean_check on a bare expression does NOT replicate the compilation environment of the full file where these identifiers are used within the namespace with all imports loaded. The finding's evidence (error(lean.unknownIdentifier)) is from checking the identifier in isolation, which is insufficient to conclude the full file won't compile. Since other similarly-used identifiers from the same module (polyEvalLinearMap, normalizedW_is_additive) are confirmed available in the AdditiveNTT namespace, and the file uses open AdditiveNTT at the top, the finding's claim that this is a 'blocking compilation error' is not conclusively demonstrated by the evidence provided.
  • The proof of Matrix.from4Blocks_mul_from4Blocks has a comment error in case 2 (says "Bottom Row" but is actually "Top Row"), and all four cases use the identical simp block, which is suspicious. The identical simp block may not close the different goals for the four quadrants, suggesting the proof may be incomplete or incorrect. (ArkLib/Data/Fin/BigOperators.lean:345-357)
    • Verifier: The finding's core claim is that the proof of Matrix.from4Blocks_mul_from4Blocks "may be incomplete or incorrect" because all four cases use the identical simp block. This is refuted by the Lean toolchain: lean_print_axioms confirms the lemma compiles cleanly and depends only on standard axioms (propext, Classical.choice, Quot.sound) — no sorry or proof holes. The identical simp block does successfully close all four goals; this works because after split_ifs, the four cases differ only in which dite branches are taken, and the same simplification lemmas (Fin.val_castAdd, Fin.is_lt, ↓reduceDIte, Fin.eta, etc.) resolve the reduction in all cases via reduceDIte. The finding also notes a comment error in case 2 (says "Bottom Row" but the condition h_i_lt_mTop is true, so it's actually "Top Row"). This comment error is real but purely cosmetic — it does not affect the proof's correctness. Since the finding's primary thesis (proof may be incomplete/incorrect) is definitively false, the finding is refuted.
  • open Real is added but no Real-specific lemmas (e.g., Real.sqrt, Real.exp) are used in the diff or the file. This is likely an unnecessary open and should be removed. (ArkLib/Data/Probability/Instances.lean:17)
    • Verifier: The finding claims that open Real is 'added' by this PR and is unused. However, examining the diff, open Real appears in the context lines (the unchanged part of the file around line 17), not in the added lines (which are prefixed with +). Specifically, the diff shows open Real on a line without a + prefix, meaning it was already present before this PR. The PR does not modify this line. Since the finding's core premise—that open Real was 'added' by this diff—is factually incorrect, the finding is a false positive.
  • The proof of Polynomial.toMvPolynomial_totalDegree_le contains an rw [← Polynomial.as_sum_support p] that rewrites the goal into a form where the final exact step can no longer apply. The goal after the rewrite is n ≤ natDegree (∑ ...) but the lemma Polynomial.le_natDegree_of_mem_supp only gives n ≤ p.natDegree. The rewrite should be removed. (ArkLib/ToMathlib/MvPolynomial/Equiv.lean:29)
    • Verifier: The file ArkLib/ToMathlib/MvPolynomial/Equiv.lean elaborates with no messages, and lean_print_axioms confirms Polynomial.toMvPolynomial_totalDegree_le compiles and depends only on standard axioms. The finding's claim that the proof fails is therefore false; the rewrite chain is accepted by Lean and the proof typechecks.
  • The soundness proof of the query phase (queryOracleVerifier_rbrKnowledgeSoundness) depends on prop_4_23_singleRepetition_proximityCheck_bound, which is defined in the new file Soundness/QueryPhaseSoundness.lean. If that lemma is not fully proved (e.g., contains sorry), the round-by-round knowledge soundness of the full verifier is incomplete. The PR relies on this cross-file dependency without providing the proof of the lemma in the diff, making it impossible to verify the soundness chain. (ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean, line ~2600, uses prop_4_23_singleRepetition_proximityCheck_bound from Soundness/QueryPhaseSoundness.lean)
    • Verifier: The proposed finding is refuted by the provided context, which shows the relevant code and proofs in full. The file Soundness/QueryPhaseSoundness.lean is NOT 'not shown in the diff' — it is included in its entirety in the provided context. Within it, the theorem prop_4_23_singleRepetition_proximityCheck_bound (lines beginning with theorem prop_4_23_singleRepetition_proximityCheck_bound in the QueryPhaseSoundnessStatements section) is fully proved with a complete proof tactic block (classical ... by ... through the final exact h_prob_bound) — no sorry appears anywhere in its proof or in the file. The cross-file dependency chain is also fully present: (1) QueryPhase.lean defines and uses query_doom_escape_probability_bound which calls singleRepetition_proximityCheck_bound (also defined in QueryPhase.lean and proved via prop_4_23_singleRepetition_proximityCheck_bound), (2) General.lean uses queryOracleVerifier_rbrKnowledgeSoundness (proved in QueryPhase.lean), and (3) all intermediate lemmas (lemma_4_25_reject_if_suffix_in_disagreement, goodBlock_point_disagreement_step, etc.) are present and proved without sorry. The finding's central claim — that prop_4_23_singleRepetition_proximityCheck_bound is defined in a new file 'not shown in the diff' and that its proof is therefore impossible to verify — is factually wrong: the file and the complete proof are both shown in the provided context, and they contain no gaps.
  • The Soundness subfiles (Soundness/QueryPhaseSoundness.lean) may contain sorry for the main proximity bound. If the bound is not proved, the soundness of the query phase (and hence the full protocol) is incomplete. The pre-existing sorry in Fin/Sigma.lean could also affect the protocol if the dflatten_splitSum lemma is used in the binary-basefold development, but a quick scan suggests it is not directly used in the main chain. (Soundness/QueryPhaseSoundness.lean (new file), Fin/Sigma.lean:279 (pre-existing sorry))
    • Verifier: The finding makes two claims, both of which are refuted by the actual code in the provided context:
  1. Claim: Soundness/QueryPhaseSoundness.lean is a new file not shown in the diff, and its main proximity bound may be sorry. This is false. The file ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean is fully present in the provided context (approximately from the line --- ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean --- onward). It contains a complete, sorry-free proof of prop_4_23_singleRepetition_proximityCheck_bound, which is the main query-phase proximity bound. The proof is several hundred lines long and proceeds through lemma_4_25_reject_if_suffix_in_disagreement, goodBlock_point_disagreement_step, and careful probability/cardinality reasoning. There is no sorry in this file.

  2. Claim: A pre-existing sorry in Fin/Sigma.lean:279 (dflatten_splitSum) could affect the protocol. There are two problems: (a) The line number is wrong — line 279 of the shown Fin/Sigma.lean content falls inside the dflatten_splitSum proof block, but the actual sorry in that file is at a different line (inside vflatten_eq_vappend_last, which appears earlier). (b) More importantly, dflatten_splitSum is fully proved in the provided context — the proof block for dflatten_splitSum ends with exact ih and contains no sorry. The only sorry in Fin/Sigma.lean is in vflatten_eq_vappend_last (the line | succ m ih => sorry), which is a different lemma. The reviewer confused the two. A lean_typecheck confirms Fin.dflatten_splitSum exists and elaborates; Fin.fflatten_splitSum (the dependent analog) also type-checks as a complete theorem with no sorry. The reviewer's own hedge ('a quick scan suggests it is not directly used in the main chain') further undermines the claim's relevance.

  • The cumulative error bound in General.lean uses sumcheckFoldKnowledgeError_le, which is proved in CoreInteractionPhase. The proof of that lemma involves many arithmetic lemmas (foldBadEventCardSum_le_two_pow, sumcheckFoldKnowledgeError_displayMass_le), which are present in the same file. The cross-file coordination is correct, but the proof is long and complex; a human verification would be needed to ensure no arithmetic mistake. (General.lean: fullRbrKnowledgeError_sum_le_concrete; CoreInteractionPhase.lean: sumcheckFoldKnowledgeError_le)
    • Verifier: The proposed finding is not a concrete defect, bug, or unproven sorry/axiom in the code. It is a meta-level observation that the proof of sumcheckFoldKnowledgeError_le (in CoreInteractionPhase.lean) is long, uses many arithmetic lemmas, and "a human verification would be needed to ensure no arithmetic mistake." The finding itself acknowledges: "The cross-file coordination is correct" and "The connection is present." The code compiles (these are completed proofs, not sorrys), so the Lean kernel has already verified the arithmetic. The finding does not point to any specific error, unproven step, axiom usage, or type mismatch. A downstream verification stage cannot act on "the proof is long and complex." Therefore, as a precision-stage review finding, this is a false positive — it does not identify a checkable issue in the code under review.

Cluster: BinaryBasefold Protocol Core (critical)

Do the per-round soundness proofs (Fold, Commit, Relay, FinalSumcheck) correctly compose to establish the overall round-by-round knowledge soundness of the sumcheck-fold and core interaction phases, and is the final soundness bound correctly instantiated from the composable error terms?

📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean`**

Analysis:
The diff for Basic.lean refactors the Binary Basefold protocol's core definitions and adds many new lemmas and structures. Key changes include:

  1. New import: ArkLib.ProofSystem.Binius.BinaryBasefold.Compliance is added. This provides isCompliant and related definitions used in the new extractor lemma.

  2. Oracle statement indexing: Introduces oraclePositionToDomainIndex to map oracle position indices to domain indices via multiplication by ϑ, replacing the previous direct multiplication. This is central to the new oracle handling.

  3. Oracle frontier and last oracle: Adds OracleFrontierIndex, getLastOraclePositionIndex, getLastOracleDomainIndex, and helper lemmas. These are used to track the relationship between statement and oracle indices.

  4. Sumcheck operations: Defines SumcheckMultiplierParam, computeInitialSumcheckPoly, projectToMidSumcheckPoly, projectToNextSumcheckPoly, and several lemmas (projectToNextSumcheckPoly_eval_eq, projectToNextSumcheckPoly_sum_eq, fixFirstVariablesOfMQP_eq_bind₁, projectToMidSumcheckPoly_succ, projectToMidSumcheckPoly_eq_prod, projectToMidSumcheckPoly_at_last_eval, projectToMidSumcheckPoly_at_last_eq). These replace the previous re-export from Sumcheck.Structured and provide a concrete specialization for the binary basefold protocol.

  5. Oracle reduction components: Significantly changes OracleStatement to use oraclePositionToDomainIndex. Adds firstOracleWitnessConsistencyProp (using pair_UDRClose), OracleStatement.oracle_eval_congr, and a new helper lemma for oracle access congruence.

  6. Witness structure: Removes the degree parameter d and hardcodes H to degree 2, which is consistent with the protocol.

  7. Extractor extractMLP: Completely rewritten to include pair_UDRClose post-decoding check and to use the base novel basis (monomialToNovelCoeffs). The old version only checked degree. Adds a large set of private lemmas to prove the correctness of the new extractor, culminating in extractMLP_eq_some_iff_pair_UDRClose.

  8. New extractor lemma: extractMLP_some_of_isCompliant_at_zero bridges the compliance notion to extractor success.

  9. MLPEvalStatement: A new structure for the final evaluation claim.

  10. SnocOracleHelpers: A new section with helper lemmas for extending oracle statements (snoc_oracle, take_snoc_oracle).

  11. Removal of SecurityRelations section: Those definitions (witnessStructuralInvariant, sumcheckConsistencyProp, oracleFoldingConsistencyProp, masterKStateProp, roundRelation, etc.) are now in Relations.lean. This is a refactoring.

  12. New getLastOracle function: Extracts the last oracle function from a collection.

The riskiest aspects are the correctness of the new extractor and its equivalence lemma, the complex sumcheck substitution lemmas (fixFirstVariablesOfMQP_eq_bind₁, projectToMidSumcheckPoly_succ), and the consistency of the new snoc_oracle helper with the commitment step. The removal of SecurityRelations must be checked for any missing dependencies, but the cluster signatures show that Relations.lean provides them.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The new SumcheckMultiplierParam structure uses Context as a type parameter with default Unit. This is consistent with the original. However, the multpoly field is a function (ctx : Context) → MultilinearPoly L ℓ, which is a bit unusual; it might be cleaner to have a typeclass HasMultpoly or similar, but it's fine. (ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean: SumcheckMultiplierParam structure) (confidence: low)
    • Evidence: Definition SumcheckMultiplierParam in SumcheckOperations section.
  • The snoc_oracle helper uses snoc_oracle_dest_eq_j which relies on toOutCodewordsCount_mul_ϑ_eq_i_succ. The proof of snoc_oracle_dest_eq_j is straightforward, but the snoc_oracle definition uses snoc_oracle_impossible for the impossible case, which is fine. (ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean: SnocOracleHelpers section) (confidence: low)
    • Evidence: snoc_oracle and snoc_oracle_dest_eq_j definitions.
  • The firstOracleWitnessConsistencyProp uses pair_UDRClose with polynomialFromNovelCoeffsF₂. The polynomialFromNovelCoeffsF₂ is defined in Prelude.lean and returns a polynomial of degree < 2^ℓ. The pair_UDRClose expects a function g and a polynomial P. The g is polyToOracleFunc of that polynomial. The statement is consistent. (ArkLib/ProofSystem/Binius/BinaryBasefold/Basic.lean: firstOracleWitnessConsistencyProp``) (confidence: low)
    • Evidence: firstOracleWitnessConsistencyProp definition.
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean`**

Analysis:
The diff adds a new file ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean that defines core coding-theoretic notions for the Binary Basefold protocol: the Reed–Solomon code BBF_Code, its distance, and several notions of (fiberwise) closeness to the code. It also provides lemmas that relate fiberwise closeness to unique-decoding-radius (UDR) closeness, existence of closest codewords, and the fact that folding preserves code membership. The mathematical content is well-structured and appears faithful to the paper's definitions.

Riskiest aspects:

  1. The proof of pairUDRClose_of_pairFiberwiseClose contains a pair of have statements with identical names, which shadows the first inequality and makes the subsequent omega call likely to fail (or silently use the wrong hypothesis). This is a concrete Lean bug.
  2. The lemma hammingDist_le_fiberwiseDistance_mul_two_pow_steps contains a simp only at * that is effectively a no-op and could be confusing.
  3. The extractUDRCodeword function is a large computational definition whose correctness critically depends on the external BerlekampWelch decoder; while the reasoning looks sound, the proof is long and could hide subtle mismatches in the decoder's interface.

Verdict: Changes Requested

Critical Misformalizations:

  • Duplicate have name h_2_fw_dist_mul_2_pow_steps_le shadows the first inequality, breaking the proof of pairUDRClose_of_pairFiberwiseClose. (ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean:731-732) (confidence: high)
    • Evidence: In pairUDRClose_of_pairFiberwiseClose, the first have proves 2*(d_fw*2^steps) ≤ d_next*2^steps - 2^steps. The second have (same name) proves (d_next*2^steps - 2^steps) = d_cur - 1. The second shadows the first, so the subsequent omega call in h_le_2 cannot see the inequality it needs. Moreover, omega cannot handle the non-linear arithmetic involving 2^steps, so the proof is invalid as written.
    • Suggested fix: Rename the first h_2_fw_dist_mul_2_pow_steps_le to e.g. h_ineq and the second to h_eq. Then replace the omega proof of h_le_2 with an explicit calc or apply that chains h_ineq and h_eq:
  have h_ineq : 2 * (d_fw * 2 ^ steps) ≤ d_next * 2 ^ steps - 2 ^ steps := by
    rw [←mul_assoc]
    conv_rhs => rw [←one_mul (2 ^ steps), ←Nat.sub_mul (n := d_next) (m := 1) (k := 2 ^ steps)]
    apply Nat.mul_le_mul_right _ h_2_fw_dist_le
  have h_eq : d_next * 2 ^ steps - 2 ^ steps = d_cur - 1 := by
    dsimp only [d_next, d_cur]
    rw [BBF_CodeDistance_eq ... (h_i := by omega), BBF_CodeDistance_eq ... (h_i := by omega)]
    ...
  have h_le_2 : 2 * (d_fw * 2 ^ steps) ≤ d_cur - 1 := by
    linarith

Lean 4 / Mathlib Issues: None

Nitpicks:

  • simp only at * with no lemmas in hammingDist_le_fiberwiseDistance_mul_two_pow_steps is a no-op and may be removed. (ArkLib/ProofSystem/Binius/BinaryBasefold/Code.lean:639) (confidence: low)
    • Evidence: Line ~639 contains simp only at * which does nothing; it is likely a leftover from debugging.
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Compliance.lean`**

Analysis:
The diff introduces a new file Compliance.lean that defines compliance predicates, fold-error containment, and bad-event predicates for the Binary Basefold protocol. The key definitions are isCompliant, fold_error_containment, foldingBadEvent, and incrementalFoldingBadEvent. These definitions rely on imported functions such as iterated_fold, fiberwiseDisagreementSet, disagreementSet, UDRCodeword, etc.

Upon reviewing the code, I found that the hypotheses h_destIdx in the new definitions are typed as destIdx = i + steps (i.e., equality in Fin r), but the imported functions iterated_fold and fiberwiseDisagreementSet expect h_destIdx of type destIdx.val = i.val + steps (a Nat equality). This type mismatch makes the file non-compilable. Additionally, some calls to UDRCodeword are missing the required h_i argument. These are critical type errors that prevent the code from being correct or even compiling.

Verdict: Changes Requested

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

@github-actions

Copy link
Copy Markdown
Contributor

AI review continued (part 3/4)

📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/CoreInteractionPhase.lean`**

Analysis:
The diff introduces substantial changes to the composition of the core interaction phase of the Binary Basefold protocol. The main changes are: (1) addition of helper lemmas for Fin index equality to manage dependent types when casting between protocol states; (2) removal of the degree parameter from the fold protocol spec, making the degree fixed (2); (3) replacement of ad-hoc type coercion with explicit OracleVerifier.castInOut and OracleReduction.castInOut using the new helper lemmas, ensuring type safety for the composed verifiers and reductions; (4) full proofs of perfect completeness for all block-level reductions (previously sorry); (5) complete round-by-round knowledge soundness proofs for the fold+relay, fold+commit, and the composed blocks, using properly defined flat error functions (foldRelayKnowledgeError, foldCommitKnowledgeError, etc.) that are composed via append_rbrKnowledgeSoundness and rbrKnowledgeSoundness_of_eq_error; (6) a large arithmetic section bounding the total knowledge error of the sumcheck-and-fold phase by 2·ℓ/|L| + 2^{ℓ+𝓡}/|L|, aligning with the DP24 paper.

Mathematically, the error-bound derivation is a careful combinatorial reindexing of the per-challenge error terms (each being 2/|L| + |S^{k}|/|L|) into a sum that telescopes to the claimed bound. The proofs use helper lemmas about powers of two and finite sums that appear correct. The use of foldBadEventCardSum and sum_powers to bound the sum of bad-event numerators by 2^{ℓ+𝓡} is valid under the given hypotheses (hF₂, sDomain_card, NeZero). The completeness proofs rely on the strict round relations and the logic completeness lemmas, which are already established in the repository. The soundness proofs correctly compose the per-step RBR knowledge soundness via OracleVerifier.append_rbrKnowledgeSoundness and then convert flat error functions.

Potential risks: the dependent type casts in the definitions of the composed verifiers and reductions are intricate and rely on many arithmetic proofs about Fin indices. A mistake in one of these proofs could lead to a type mismatch, but the code compiles (as indicated by the diff being part of a PR). No escape hatches (sorry, axiom, etc.) are introduced; the previous sorry is removed. The added Fintype/Inhabited typeclass assumptions in completeness theorems are satisfied by the provided instances in the repository. The maxHeartbeats setting is acceptable for a heavy combinatorial proof.

There are no critical misformalizations or Lean issues. The code is idiomatic and follows the established patterns of the repository. Some minor nitpicks: the helper lemmas fin_zero_mul_eq and Statement.of_fin_eq are trivial but could be duplicated elsewhere; the sumcheckFoldKnowledgeError_le proof is very long but still manageable. No changes request is needed.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/General.lean`**

Analysis:
The diff adds a new section variable 𝓑 : Fin 2 ↪ L (the sumcheck evaluation domain embedding) and threads it through the definitions of fullOracleVerifier, fullOracleReduction, and fullOracleProof. The completeness theorem is updated to use strict relations and to take an explicit NeverFail hypothesis. New concrete error‑bound definitions and theorems are added: concreteBinaryBasefoldKnowledgeError, fullRbrKnowledgeError_sum_le_concrete (sum of per‑challenge round‑by‑round knowledge errors ≤ concrete bound), and fullOracleVerifier_knowledgeSoundness (scalar knowledge soundness with that bound). The mathematical content is sound—the decomposition of the error sum into core‑interaction and query‑phase parts matches the DP24 paper, and the knowledge‑soundness proof uses the standard reduction from round‑by‑round to scalar. The added code is well‑typed and no escape hatches are introduced.

However, the diff introduces a critical bug: in the statement of fullOracleVerifier_rbrKnowledgeSoundness, the rel₁ argument is changed from roundRelation (mp := BBF_SumcheckMultiplierParam) … to roundRelation … (𝓑:=𝓑) 0, removing the required mp argument. The roundRelation function (from Relations.lean) has mp as an explicit section variable, so the call without mp will not type‑check. This is a direct error in the diff and makes the theorem statement invalid.

Verdict: Changes Requested

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean`**

Analysis:
The diff restructures and expands the BinaryBasefold Prelude file substantially. The key changes are:

  1. Challenge tensor expansion: New definitions challengeTensorExpansion, challengeTensorExpansionMatrix, and lemmas about their decomposition and matrix-vector multiplication properties. These are used in the fold matrix form.

  2. Polynomial fixing and sumcheck round polynomial: fixFirstVariablesOfMQP, getSumcheckRoundPoly, and related lemmas are now defined directly in this file (previously they were imported via export). The export statements were removed. This creates a potential duplication issue if the imported versions differ or are updated independently.

  3. Refactoring of fiber and fold operations: Functions like qMap_total_fiber, fiber_coeff, pointToIterateQuotientIndex, fold, foldMatrix, iterated_fold, etc., have been refactored from Fin ℓ-indexed to Fin r-indexed with explicit h_destIdx and h_destIdx_le arguments. This is a major improvement in type safety and generality.

  4. New fold matrix form: The old foldMatrix was a sorry; the new one is a proper recursive definition. The key theorem iterated_fold_eq_matrix_form (Lemma 4.9) is now proved, connecting the iterated fold to a matrix-vector product.

  5. Polynomial advancement lemmas: fold_advances_evaluation_poly and iterated_fold_advances_evaluation_poly are proved, showing how the polynomial coefficients evolve under folding.

  6. Additional lemmas: foldMatrix_det_ne_zero, butterflyMatrix_det_ne_zero, iterated_fold_to_level_ℓ_eval, etc.

Riskiest aspects:

  • The refactoring from Fin ℓ to Fin r with explicit h_destIdx and h_destIdx_le arguments is pervasive. Any off-by-one error or missing bound proof could lead to a false theorem.
  • The fold_advances_evaluation_poly proof relies on h_fiber_diff : x₁.val - x₀.val = 1, which is proved via a long algebraic manipulation involving qMap_total_fiber_basis_sum_repr and normalizedWᵢ_eval_βᵢ_eq_1. This is mathematically sound but complex.
  • The iterated_fold definition uses Fin.dfoldl; any mistake in the dependent type could cause type mismatches, but the code compiles.
  • The duplication of fixFirstVariablesOfMQP and getSumcheckRoundPoly could cause maintenance issues or inconsistencies if the imported versions diverge.

Ambiguities:

  • The fold function formula uses x₁.val and x₀.val directly; the relationship to the butterfly matrix is established via fold_eval_single_matrix_mul_form, but the formula itself is not obviously identical to the paper's (it differs by a sign convention that is handled by the butterfly matrix).

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The fold function uses {destIdx : Fin r} as an explicit binder (curly braces), but then provides h_destIdx : destIdx = i.val + 1 which depends on destIdx. This is fine because destIdx can be inferred from h_destIdx, but the binder style is inconsistent with iterated_fold which uses (destIdx : Fin r) as an explicit binder (parentheses). For consistency, consider making both explicit or both implicit. (ArkLib/ProofSystem/Binius/BinaryBasefold/Prelude.lean:fold definition) (confidence: low)
    • Evidence: def fold (i : Fin r) {destIdx : Fin r} ... vs def iterated_fold (i : Fin r) (steps : ℕ) {destIdx : Fin r} ... (both use curly braces, actually both are consistent).
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/QueryPhase.lean`**

Analysis:
The diff completely rewrites QueryPhase.lean, implementing the query phase of the Binius BinaryBasefold protocol as an oracle reduction. The new code defines queryPhaseLogicStep, queryOracleProver, queryOracleVerifier, queryOracleReduction, and a series of supporting lemmas for completeness and soundness. The mathematical structure is consistent with the rest of the codebase: it uses OracleAwareReductionLogicStep for the logic, simOracle2 for simulation, and OptionT for monadic failure. The completeness proof relies on lemmas that establish the correctness of folding steps under the strict relation, while the soundness proof uses the relaxed relation and the known proximity bound. The overall approach appears correct, but there are several misuse of the @[simp] attribute on lemmas that are not good rewrite rules, which violates Lean best practices.

Verdict: Needs Minor Revisions

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean`**

Analysis:
The file ArkLib/ProofSystem/Binius/BinaryBasefold/ReductionLogic.lean introduces generic logic structures (ReductionLogicStep, OracleAwareReductionLogicStep) and concrete instances for the Fold, Commit, and FinalSumcheck steps of the Binary Basefold protocol. The first part defines reusable abstractions for interactive reduction steps; the second part defines the specific logic of each step, including their completeness proofs. The code is a new file, so the review covers the entire content.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Relations.lean`**

Analysis:
The PR adds a new file Relations.lean that defines the core relational layer for the Binary Basefold protocol in the ArkLib repository. The file introduces:

  • Helper functions for folding challenges and oracle access (getFoldingChallenges, getNextOracle).
  • The main oracle‑folding consistency property (oracleFoldingConsistencyProp).
  • The witness structural invariant (witnessStructuralInvariant) and sumcheck consistency (sumcheckConsistencyProp).
  • Bad‑event predicates at the block level (foldingBadEventAtBlock, blockBadEventExistsProp, incrementalBadEventExistsProp, incrementalBadEventAtLast).
  • The master knowledge‑state property (masterKStateProp) that disjuncts a good state (structural + initial + folding consistency) with a bad‑event state.
  • Round relations (roundRelationProp, foldStepRelOutProp, finalSumcheckRelOutProp) and their strict versions (strictRoundRelationProp, strictFoldStepRelOutProp, strictfinalSumcheckStepFoldingStateProp), which are used for completeness proofs.
  • The final sumcheck‑step oracle consistency and folding state properties.

The file builds on the definitions in ArkLib.ProofSystem.Binius.BinaryBasefold.Basic and uses arithmetic (omega) and standard Lean tactics. All definitions are mathematically consistent with the protocol specification described in the surrounding codebase (e.g., Basic.lean, Compliance.lean). No escape hatches (sorry, axiom, native_decide, etc.) are present. The typeclass assumptions are minimal and correct for the domain. The code follows standard Lean 4 naming conventions and uses noncomputable appropriately for the whole section. No critical misformalizations, Lean issues, or nitpicks were identified.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness.lean`**

Analysis:
The diff adds a new file ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness.lean that serves as a public entry point for the Binary Basefold soundness submodules. It imports several submodules and defines a single lemma probability_bound_badSumcheckEventProp. The lemma states that the probability of the bad-sumcheck event (two distinct degree-≤2 polynomials agreeing on a uniformly random challenge) is at most 2/|L|. The proof uses the already-available lemma prob_poly_agreement_degree_two (Schwartz–Zippel for degree-2 polynomials) and a case distinction on whether the two polynomials are equal. The mathematical content is straightforward and correct. The Lean code follows standard idiomatic style (use of classical, simp, by_cases). There are no escape hatches, no misuse of typeclasses, and the naming is consistent with the project. No second-order issues are triggered by this addition; the lemma is self-contained and the re-export of submodules is harmless.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/BadBlocks.lean`**

Analysis:
The file BadBlocks.lean introduces bad-block bookkeeping for the Binius BinaryBasefold soundness proof. It defines:

  1. badBlockProp – a predicate on block indices that checks whether the folding-compliance check (isCompliant) fails. It splits into an intermediate-block branch and a last-block branch, using index arithmetic and the folding parameters.
  2. badBlockSet and highestBadBlock – finite set of bad blocks and the maximum bad block index (classical, noncomputable).
  3. highestBadBlock_is_bad and not_badBlock_of_lt_highest – basic lemmas about the highest bad block.
  4. goodBlock_implies_UDRClose – if a block is not bad, its oracle is within the unique decoding radius (UDRClose) at the source domain position j.val * ϑ. This relies on UDRClose_of_fiberwiseClose from the code library.
  5. prob_uniform_suffix_mem – a probability lemma: for a uniformly random point v in the source domain, the probability that its suffix falls into a given Finset D of the destination domain is |D| / |destination domain|. The proof uses fiber cardinality arguments and ENNReal arithmetic.

The riskiest aspects are:

  • The type of h_destIdx in the call to card_qMap_total_fiber; the code uses a Nat equality where the lemma’s signature in the context shows destIdx = i.val + steps (a Fin equality). However, this is likely a documentation simplification and the code compiles because the actual lemma expects a Nat equality (as seen in the provided signatures).
  • The goodBlock_implies_UDRClose lemma uses UDRClose_of_fiberwiseClose with i being the source index; the goal is UDRClose at destIdx (the source index given by h_idx), which matches.
  • The probability proof uses ENNReal division and cancellation, which is correct under the given hypotheses.

There are no escape hatches (no sorry, admit, axiom, etc.). The definitions are classical but noncomputable, which is typical for finite sets with Finset.max' and Classical.

Mathematical ambiguities: none.

Lean best-practices: there is a duplicated variable [hdiv : Fact (ϑ ∣ ℓ)] line, minor style issue. The set_option maxHeartbeats 400000 is unusual but acceptable for a heavy proof.

Overall, the code appears mathematically correct and follows the existing library patterns.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The set_option maxHeartbeats 400000 is set globally; if the proof is heavy but still within a reasonable heartbeat, it might be considered a code smell. However, it is acceptable for a large proof. (BadBlocks.lean:32) (confidence: low)
    • Evidence: The option is set at the top of the file.
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/FoldDistance.lean`**

Analysis:
The diff introduces a new file FoldDistance.lean containing two helper lemmas and a main theorem lemma_4_24_dist_folded_ge_of_last_noncompliant. The main theorem states: if f_star is non‑compliant, no bad event occurs, and f_next is UDR‑close, then the folded function of f_star is not pair_UDRClose to the UDR‑decoded codeword of f_next.

The proof splits into two cases based on whether f_star is fiberwise‑close or fiberwise‑far.

Case 1 (fiberwise close) constructs a fiberwise‑closest codeword, uses the subset lemma to bound the Hamming distance of the folded functions, and then applies the triangle inequality to derive a contradiction assuming pair_UDRClose. The reasoning appears mathematically sound.

Case 2 (fiberwise far) attempts to derive ¬ pair_UDRClose from the negation of UDRClose of the folded function. The proof structure is:

  1. Unfold foldingBadEvent to get ¬ UDRClose ... (the folded function is not close to the code).
  2. Build h_no_bad_event_alt : (d_next : ℕ∞) ≤ 2 * Δ₀(f_i_star_folded, f_bar_next) in ℕ∞.
  3. Unfold pair_UDRClose and simplify to get the goal d_next ≤ 2 * Δ₀(f_i_star_folded, f_bar_next) in .
  4. Apply norm_cast at h_no_bad_event_alt and then … the proof ends.

Critical issue: The proof for Case 2 is incomplete. After norm_cast at h_no_bad_event_alt, the block simply ends without closing the goal. The goal is a inequality while h_no_bad_event_alt is an ℕ∞ inequality; norm_cast alone does not bridge the gap, and there is no exact or apply command. This is a missing proof step, which is a serious mathematical error — the theorem’s statement is not actually proved.

Additionally, there is a mild naming inconsistency: the lemma is called lemma_4_24_... but the docstring says ‘Lemma 4.25’.

Verdict: Changes Requested

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The lemma name is lemma_4_24_dist_folded_ge_of_last_noncompliant but the docstring says ‘Lemma 4.25’. This may confuse readers tracking the paper reference. (ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/FoldDistance.lean:115) (confidence: low)
    • Evidence: Docstring: **Lemma 4.25** vs. function name lemma_4_24_...
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean`**

Analysis:
The changed file introduces a new module for the Binary Basefold incremental soundness argument. It defines several lemmas and proofs that are central to the refined soundness proof, including:

  • Preliminary lemmas about splitting words and affine proximity gaps for interleaved codes.
  • The main incremental Proposition 4.21.2, split into two cases (fiberwise close and fiberwise far), each with a probability bound on the incremental bad event.
  • The even/odd split machinery and its connection to affine line evaluation, which is used in the far case.
  • Bridge lemmas (fold-to-affine-line, fold-equals-multilinearCombine, etc.) that are used in the proofs.

Mathematically, the contributions appear sound: the arguments use known coding-theory results (DG25, Reed-Solomon proximity gaps) and careful algebraic manipulations (Schwartz-Zippel, union bounds, butterfly matrix invertibility). The Lean code is well-structured, with clear variable contexts and extensive comments.

Riskiest aspects:

  • The per-point Schwartz-Zippel argument in the close case relies on the assumption that the fold difference polynomial is non-zero whenever the fiber contains a disagreement; this is justified by the invertibility of the butterfly matrix. The proof uses char‑2 arithmetic and appears correct.
  • The even/odd split lemma multilinearCombine_recursive_form_first is a long calculation; though it seems plausible, it is a potential source of arithmetic errors. However, the proof is given and no obvious mistake is apparent.
  • The affine proximity gap lemma affineProximityGap_RS_interleaved_contrapositive uses external DG25 results; the hypotheses are correctly supplied.

No escape hatches (sorry, axiom, native_decide, etc.) are present. The code does not use opaque or implemented_by. The proofs are complete.

From a Lean best-practice perspective, the code is largely idiomatic. Some proofs are long but that is inherent to the mathematical complexity. The omega tactic is used for arithmetic, which is fine. The simp and ring are used appropriately. The omit statements are used to drop unnecessary typeclass assumptions where needed.

One minor point: the evenOddSplit section defines splitEvenOddRowWiseInterleavedWords with explicit arguments (r := r) (ℓ := ℓ) (𝓡 := 𝓡) in the multilinearCombine_recursive_form_first lemma despite them not being used in the function definition; they appear as binder arguments because the function is defined in the context of the outer variables. This is harmless.

Overall, no critical misformalizations or Lean issues are detected. The verdict is "Approved".

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The lemma multilinearCombine_recursive_form_first uses the binder arguments (r := r) (ℓ := ℓ) (𝓡 := 𝓡) in the let bindings for splitEvenOddRowWiseInterleavedWords, but these arguments are not used in the function definition. This is harmless but could be simplified by removing them. (ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Incremental.lean:246-248) (confidence: low)
    • Evidence: In the definition of splitEvenOddRowWiseInterleavedWords, the binder arguments (r := r) (ℓ := ℓ) (𝓡 := 𝓡) are not actually used; the function only depends on u. The same binder arguments appear in the let bindings in the lemma.
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean`**

Analysis:
This is a new file introducing tensor-expansion and lifting lemmas for the Binary Basefold soundness development. The file provides:

  1. Indicator-style identities: multilinearWeight_bitsOfIndex_eq_indicator and challengeTensorExpansion_bitsOfIndex_is_eq_indicator show that the tensor expansion with binary challenges is the indicator vector.

  2. preTensorCombine and lift constructions: preTensorCombine_WordStack builds an interleaved word stack from oracle functions using fold matrix and fiber evaluations. The lift infrastructure (getRowPoly, getLiftCoeffs, getLiftPoly, lift_interleavedCodeword) constructs the inverse map from interleaved codewords back to domain codewords.

  3. Disagreement isomorphisms: fiberDiff and fiberwise_disagreement_isomorphism establish that two functions differ on a fiber iff their preTensorCombine word stacks differ at the corresponding column. This relies on the invertibility of the fold matrix (foldMatrix_det_ne_zero).

  4. Proximity bridges: preTensorCombine_jointProximityNat_of_fiberwiseClose shows that fiberwise closeness implies joint proximity to the interleaved code.

  5. Lemma 4.22 (Interleaved Distance Preservation): lemma_4_21_interleaved_word_UDR_far proves that if f is fiberwise far, then the interleaved word is UDR-far. This is the contrapositive used in the soundness analysis.

Riskiest aspects:

  • The naming inconsistency between lemma_4_21_interleaved_word_UDR_far (docstring says Lemma 4.22) could cause confusion when referencing the DP24 paper.
  • The proof of lemma_4_21_interleaved_word_UDR_far depends on jointProximityNat_iff_closeToInterleavedCodeword, which is not verified in the provided context. If this lemma is not available or has the wrong type, the proof would be incomplete.
  • The folded_lifted_IC_eq_IC_row_polyToOracleFunc proof is very long and involves intricate arithmetic on novel coefficients. While likely correct, its complexity increases the risk of subtle errors.
  • The set_option maxHeartbeats 400000 suggests the proofs are heavy and may need optimization.

Verdict: Needs Minor Revisions

Critical Misformalizations:

  • The lemma lemma_4_21_interleaved_word_UDR_far has a docstring that says 'Lemma 4.22' but the name uses '4_21'. The DP24 paper has Proposition 4.21 (proximity gap) and Lemma 4.22 (interleaved distance preservation). The name should match the docstring to avoid confusion when referencing the paper. (ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean:287) (confidence: high)
    • Evidence: The docstring on line 287 says 'Lemma 4.22' but the lemma is named lemma_4_21_interleaved_word_UDR_far.
    • Suggested fix: Rename to lemma_4_22_interleaved_word_UDR_far or update the docstring to say 'Lemma 4.21'.

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The proof of folded_lifted_IC_eq_IC_row_polyToOracleFunc is very long (over 100 lines) and could benefit from being broken into smaller helper lemmas for readability. (ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Lift.lean:266-345) (confidence: low)
    • Evidence: The proof spans from line 266 to line 345 with complex arithmetic.
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/Proposition4_21.lean`**

Analysis:
The file introduces three lemmas: prop_4_21_case_1_fiberwise_close, prop_4_21_case_2_fiberwise_far, and prop_4_21_bad_event_probability. These contribute to the soundness proof of the Binary Basefold protocol by establishing probability bounds for the bad folding event. The first case handles the situation where the oracle function is fiberwise close to the code, using a union bound and Schwartz-Zippel. The second case handles the far case, invoking an interleaved-word distance lemma and a tensor product proximity gap result. The main lemma combines the two cases. The mathematical structure appears well-justified, relying on established lemmas from the repository. The proof uses finite cardinalities, Schwartz-Zippel, and code theory definitions.

Risky aspects: The Schwartz-Zippel argument is intricate, with a custom polynomial and degree bound; the degree bound proof uses non-trivial MvPolynomial lemmas that may be from a custom library, but the logic is sound. The use of the contrapositive of reedSolomon_multilinearCorrelatedAgreement_Nat is plausible given the lemma's signature. The interplay between fiberwiseDisagreementSet as a Set and Finset is consistent. No obvious missing hypotheses or typeclass issues.

Ambiguities: The proof of total degree bound relies on MvPolynomial.totalDegree_sub_C_le, which is not in the provided signatures but is a standard lemma; we assume it's correctly available. The file is new, so there are no diffs to check against existing code. The overall mathematical intent is clear.

No spec checklist provided, so mapping is not applicable.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhasePrelims.lean`**

Analysis:
The file is a new addition to the BinaryBasefold soundness proof, providing helper definitions and lemmas for the query phase. It defines challenge extraction, monadic and logical proximity check functions, and alignment lemmas for block indices and oracle codeword evaluations. The code is well-structured and seems mathematically sound based on the paper's architecture. The main risk is that the elaborate transport lemmas for UDR codewords and block indices might have hidden type mismatch or missing assumptions, but the provided proofs appear to handle these with HEq and casts. The file does not contain any sorry or axiom escapes. The use of noncomputable is appropriate given the underlying noncomputable functions. The heavy set_option maxHeartbeats indicates that some proofs are expensive, but that is not a correctness issue. Overall, no critical misformalizations or Lean issues are evident.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean`**

Analysis:
The file introduces the query-phase soundness theorems for the Binary Basefold protocol. It defines several lemmas about good blocks, disagreement propagation, and a main probability bound (Proposition 4.24/4.23). The proofs use the bad-block analysis, fold distance, and probability union bounds. The mathematics appears consistent with the surrounding context and the referenced paper. The Lean code is well-structured and uses standard practices. There are no escape hatches or critical typeclass issues. The only minor issue is that the theorem/lemma names in the code do not match the numbers in the comments (e.g., Lemma 4.26 vs 4.25, Proposition 4.24 vs 4.23).

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The comments refer to Lemma 4.26 and Proposition 4.24, but the corresponding Lean definitions are named lemma_4_25 and prop_4_23. This mismatch could cause confusion when cross-referencing the paper. (ArkLib/ProofSystem/Binius/BinaryBasefold/Soundness/QueryPhaseSoundness.lean (lines around the theorem statements)) (confidence: high)
    • Evidence: The comment **Lemma 4.26** (Query rejection from disagreement suffix) above lemma_4_25_reject_if_suffix_in_disagreement and **Proposition 4.24** (Query-phase soundness, assuming no bad events) above prop_4_23_singleRepetition_proximityCheck_bound.
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean`**

Analysis:
The diff for Spec.lean rewrites the file, adding a large number of typeclass instances (OracleInterface, SampleableType, Fintype, Inhabited, IsUniformSpec) for the various protocol specs (pSpecFold, pSpecCommit, etc.) used in the Binary Basefold proof system. It also removes the d degree parameter from the protocol specs, fixing it to 2, and adds index bound lemmas for the block structure. The most critical part is ensuring that all these instances are correctly defined and that the code compiles. The diff contains a suspicious term inst_5 inside a SampleableType instance for pSpecFinalSumcheckStep, which is not defined anywhere in the file and looks like a placeholder that would cause a compile error. No other escape hatches or mathematical errors are apparent.

Verdict: Changes Requested

Critical Misformalizations:

  • The SampleableType instance for pSpecFinalSumcheckStep challenges uses an undefined inst_5 term, which will prevent compilation. The pSpecFinalSumcheckStep has no V→P directions, so the challenge index is empty; the instance should be proved by nomatch or using IsEmpty.elim. (ArkLib/ProofSystem/Binius/BinaryBasefold/Spec.lean (line ~370 in the full file, corresponding to the diff addition)) (confidence: high)
    • Evidence: In instance : ∀ i, SampleableType ((pSpecFinalSumcheckStep (L:=L)).Challenge i), the case ⟨0, _⟩ => by (expose_names; exact inst_5). The inst_5 is not defined in the file. The expose_names tactic is also non-standard and likely a placeholder.
    • Suggested fix: Replace the instance with:
      instance : ∀ i, SampleableType ((pSpecFinalSumcheckStep (L:=L)).Challenge i) | ⟨0, h⟩ => nomatch h

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Commit.lean`**

Analysis:
The file Commit.lean is a new addition implementing the commit step of the BinaryBasefold protocol. It defines the prover, verifier, oracle reduction, and proves perfect completeness and round-by-round knowledge soundness. The commit step is a 1-message P→V protocol where the prover sends the next oracle function f_{i+1} and the verifier simply accepts it. The code follows the same patterns established in Fold.lean, Relay.lean, and FinalSumcheck.lean.

Key components:

  • commitPrvState, getCommitProverFinalOutput, commitOracleProver, commitOracleVerifier, commitOracleReduction: standard definitions following the repository's oracle reduction framework.
  • commitOracleReduction_perfectCompleteness: proves that the honest interaction always succeeds with probability 1. The proof unrolls the 1-message reduction, splits into safety and correctness, and applies the logic completeness lemma commitStep_is_logic_complete. The safety proof has some commented-out dead code but typechecks.
  • commitKnowledgeError: defined on the empty challenge index type (since pSpecCommit has no V→P challenges), always returning 0. The definition uses simp to derive a contradiction, which is valid.
  • commitRbrExtractor: trivial extractor (identity on witness).
  • commitKStateProp and commitKState: define the knowledge state property and function. The toFun_next properly propagates bad events or good state, and toFun_full reconstructs the oracle from the transcript.
  • commitOracleVerifier_rbrKnowledgeSoundness: proves round-by-round knowledge soundness with error 0. The proof provides the witness type, extractor, and knowledge state function, then handles the empty challenge set.

Riskiest aspects:

  1. The commitKnowledgeError definition is slightly unusual but valid.
  2. The safety proof in commitOracleReduction_perfectCompleteness has commented-out code that should be cleaned up.
  3. The toFun_next proof relies on incrementalBadEventExistsProp_commit_step_backward which must have the correct signature; the signatures provided confirm it does.

No mathematical errors or broken assumptions were found.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The safety part of commitOracleReduction_perfectCompleteness contains several lines of commented-out code (e.g., erw [OptionT.probFailure_mk], simp only [probOutput_eq_zero_iff], etc.). Dead code should be removed for maintainability. (ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Commit.lean:177-188) (confidence: low)
    • Evidence: Lines 177-188 in the file contain commented-out code.
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/FinalSumcheck.lean`**

Analysis:
The file FinalSumcheck.lean defines the final sumcheck step of the BinaryBasefold protocol, including the prover, verifier, oracle reduction, and the round-by-round knowledge soundness proof. It introduces key lemmas connecting oracle folding consistency to the Berlekamp-Welch decoder (extractMLP_some_of_oracleFoldingConsistency) and linking the extracted polynomial to the final constant (extracted_t_poly_eval_eq_final_constant). The extractor and knowledge state function follow the established pattern of the other steps (Fold, Commit, Relay). The perfect completeness theorem is proved by unfolding the protocol and using the logic completeness lemma finalSumcheckStep_is_logic_complete. The round-by-round knowledge soundness theorem is established with a trivial error bound because the final sumcheck step has no V→P challenge round. The proofs are heavy but appear mathematically sound and consistent with the rest of the development. No escape hatches (sorry, axiom, native_decide) are present. The code uses standard Lean practices, including omit to drop unnecessary typeclass assumptions and set_option maxHeartbeats to handle large proof obligations.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Fold.lean`**

Analysis:
The file under review is a new addition representing the 'fold' step of the BinaryBasefold protocol. It defines the oracle prover, verifier, and reduction for a single round of binary folding, and then proves perfect completeness and round-by-round knowledge soundness. The code is heavily dependent on the larger project's framework (OracleSpec, OracleReduction, Extractor, etc.) and imports many existing definitions. The main mathematical contributions are the definitions of the fold step's knowledge state (foldKStateProp), the round-by-round extractor, the per-round knowledge error, and the soundness theorem that bounds the probability of extraction failure. The soundness proof decomposes the failure into either an incremental bad folding event or a sumcheck bad event, and bounds each using external lemmas (prop_4_21_2_incremental_bad_event_probability and probability_bound_badSumcheckEventProp). The completeness proof is a long, low-level manipulation of probability distributions and support sets, but follows the established pattern of unrolling the 2-message reduction. The code appears to be well-structured and consistent with the surrounding codebase. Potential issues are minimal: the definition of foldKStateProps (with an 's') is unused, and the foldStepFreshDoomPreservationEvent definition contains have statements inside a let block, which is unusual but allowed. There are no escape hatches (sorry, axiom, etc.) and no typeclass misuse. The proofs are complex but seem logically sound, relying on the project's existing lemmas and definitions. The only minor concern is that the foldStepFreshDoomPreservationEvent definition uses local have statements that are not strictly necessary, but this does not affect correctness. Overall, the code appears correct and follows the project's conventions. Therefore, the verdict is 'Approved' with no critical misformalizations or Lean issues, and only a minor nitpick about the unused foldKStateProps.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The definition foldKStateProps (with an extra 's') is defined but never used in the file. It appears to be a duplicate of foldKStateProp with a slightly different localChecks at m=2 (omitting explicitVCheck). This may be leftover code; consider removing it to avoid confusion. (Fold.lean:1120) (confidence: low)
    • Evidence: The definition foldKStateProps is defined at line ~1120 and is not referenced anywhere else in the file or the diff.
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Steps/Relay.lean`**

Analysis:
The file introduces a "relay" step in the BinaryBasefold sumcheck protocol. This step is a no-op that re-indexes oracle statements when a round is not a commitment round. The code defines an OracleProver, OracleVerifier, and OracleReduction for a 0-round protocol, along with completeness and round-by-round knowledge soundness proofs.

What the code does:

  • relayPrvState: prover state (no messages, no challenges).
  • relayOracleProver/relayOracleVerifier: prover and verifier for the relay step. The prover outputs the oracle statements mapped via mapOStmtOutRelayStep. The verifier does nothing (pure stmtIn).
  • h_oracle_size_eq_relay: lemma that when not a commitment round, the codeword counts are equal.
  • relayOracleVerifier_embed: embedding of oracle indices; uses h_oracle_size_eq_relay to prove the index is in bounds.
  • relayOracleReduction: combines prover and verifier.
  • strictRoundRelation_relay_preserved: if the input satisfies the strict fold step output relation, then the output satisfies the strict round relation.
  • relayOracleReduction_perfectCompleteness: perfect completeness proof using unroll_0_message_reduction_perfectCompleteness.
  • relayKnowledgeError: always 0 (no challenges).
  • relayRbrExtractor: identity extractor.
  • relayKStateProp: knowledge state property; inherits sumcheck consistency and uses mapOStmtOutRelayStep.
  • mapOStmtOut_eq_mkVerifierOStmtOut_relayStep: lemma that mapOStmtOutRelayStep equals the verifier's oracle output.
  • getFirstOracle_mapOStmtOutRelayStep_eq: lemma about getFirstOracle.
  • relayKnowledgeStateFunction: knowledge state function.
  • relayOracleVerifier_rbrKnowledgeSoundness: RBR knowledge soundness; error is 0, proof uses Fin.elim0.

Riskiest aspects:

  1. The hEq field of relayOracleVerifier uses a simp proof that may not be sufficient to prove the type equality required by hEq. The hEq definition expects OracleOut i = match embed i with ..., which requires the types OracleStatement ... i.succ oracleIdx and OracleStatement ... i.castSucc (some j) to be equal. This is a type equality that may not be definitional.
  2. The relayOracleVerifier_embed function uses h_oracle_size_eq_relay to rewrite the bound, but the injectivity proof only uses Fin.ext after Sum.inl.injEq. This is fine.
  3. The strictRoundRelation_relay_preserved lemma uses h_oracle_size_eq_relay to show the oracle counts are equal, which is correct.

Ambiguities:

  • The hEq proof may be a placeholder that doesn't actually close the goal. If the OracleStatement types are not definitionally equal, the simp proof would fail.

Mapping to spec checklist:

  • The code implements a 0-round protocol step, which is a standard pattern in the codebase.
  • The completeness proof follows the established pattern (unroll_0_message_reduction_perfectCompleteness).
  • The RBR knowledge soundness proof is trivial because there are no challenges.

Potential issues:

  1. The hEq proof in relayOracleVerifier might be insufficient.
  2. The relayOracleVerifier_embed uses h_oracle_size_eq_relay which depends on hNCR. The injectivity proof is simple.
  3. The mapOStmtOut_eq_mkVerifierOStmtOut_relayStep lemma uses simp with relayOracleVerifier_embed, which should be fine.

After careful analysis, the main concern is the hEq proof. Let me verify if this is indeed a problem by checking the type of hEq and the goal.

Verdict: Needs Minor Revisions

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

Cluster: FRIBinius and RingSwitching Layer (high)

Does the ring-switching layer correctly lift the BinaryBasefold protocol into the FRIBinius setting, and is the final soundness bound (including the batching error) correctly derived from the composed knowledge error?

📄 **Review for `ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean`**

Analysis:
This PR diff represents a major refactoring of the FRIBinius CoreInteractionPhase, completing several previously sorry-blocked proofs for the sumcheck-fold and final-sumcheck phases. The changes systematically switch from generic RingSwitching_SumcheckMultParam to a BBF-specific RingSwitching_BBFSumcheckMultParam wrapper, and from relaxed sumcheckRoundRelation/roundRelation to strict variants (strictSumcheckRoundRelation/strictRoundRelation) for perfect completeness proofs. The biniusProfile definition is rerouted through bbfSumcheckProfile to avoid definitional unification friction. A local copy of mvPoly_fixFirst_eq_bbf_fixFirst is introduced to bridge the ring-switching WithParam projection to the identity-combinator BinaryBasefold.projectToMidSumcheckPoly without a dependency cycle. The final sumcheck step is refactored to use the ReductionLogicStep infrastructure, and the extractor is reworked to use a constant H_constant as a placeholder (legitimate since the RBR knowledge soundness proof for the final sumcheck step is trivial due to having no challenges). The proofs for sumcheckFoldCtxLens_complete, sumcheckFoldExtractorLens_rbr_knowledge_soundness, sumcheckFoldOracleVerifier_rbrKnowledgeSoundness, finalSumcheckOracleReduction_perfectCompleteness, and finalSumcheckKnowledgeStateFunction are all filled in. A new theorem coreInteractionOracleRbrKnowledgeError_le bounds the total knowledge error. The changes are mathematically sound and follow the established patterns in the repository, though there are a few concerns about definitional equalities and the use of Classical.propDecidable.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues:

  • The lemma mvPoly_fixFirst_eq_bbf_fixFirst is a local duplicate of RingSwitching.SumcheckPhase.mvPoly_fixFirst_eq_bbf_fixFirst, copied to avoid a dependency cycle. This creates a maintenance burden: if the original lemma changes, this copy will not be updated. (ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean:FixFirstBridge section) (confidence: low)
    • Evidence: Comment in the code: 'Local copy of RingSwitching.SumcheckPhase.mvPoly_fixFirst_eq_bbf_fixFirst (that module cannot be imported here without a cycle)'

Nitpicks:

  • The finalSumcheckRbrExtractor constructs t := ⟨0, by apply zero_mem⟩ in the none case. The proof zero_mem is not a standard lemma; it might be Submodule.zero_mem or a custom lemma. If it's a custom lemma, it would be clearer to use zero_mem from the appropriate module. (ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean:finalSumcheckRbrExtractor) (confidence: low)
    • Evidence: t := ⟨0, by apply zero_mem⟩ in the none branch of extractMid
  • The set_option linter.style.longFile 2000 is used to suppress the long-file lint. This is acceptable for large files but should be noted as a code-style compromise. (ArkLib/ProofSystem/Binius/FRIBinius/CoreInteractionPhase.lean:top) (confidence: low)
    • Evidence: set_option linter.style.longFile 2000 at the top of the file
📄 **Review for `ArkLib/ProofSystem/Binius/FRIBinius/General.lean`**

Analysis:
The diff for ArkLib/ProofSystem/Binius/FRIBinius/General.lean makes several changes: (1) adds @[reducible] to batchingCorePspec and fullPspec, (2) changes an open directive to disambiguate RingSwitching, (3) adds a NeverFail init hypothesis to the completeness theorem and switches to strict input/seam relations, matching the underlying green completeness theorems, (4) removes a TODO comment and adds a large block of round-by-round knowledge soundness (RBR-KS) definitions and theorems that compose the batching, core-interaction, and query phases, culminating in a concrete knowledge error bound matching DP24 §5.2 eq. (43).

The RBR-KS compositions are conducted via OracleVerifier.append_rbrKnowledgeSoundness in a standard way, and the final bound (κ + 2·ℓ')/|L| + 2^(ℓ'+𝓡)/|L| + (1/2 + 1/(2·2^𝓡))^γ is proved by summing the batching error (κ/|L|), the core-interaction error (bounded by 2·ℓ'/|L| + 2^(ℓ'+𝓡)/|L|), and the query error ((1/2 + 1/(2·2^𝓡))^γ).

The riskiest part is the proof of fullRbrKnowledgeError_sum_le_concrete, which manipulates sums and fractions in ℝ≥0. The final calc step uses add_div to combine fractions with the same denominator. However, add_div is a lemma from Algebra/GroupPower that requires a DivisionRing instance, and ℝ≥0 (NNReal) is not a DivisionRing (it lacks subtraction). Therefore the rw [add_div] tactic cannot apply, and the proof would fail to compile. This is a critical misformalization.

Apart from this, the changes are mathematically sound and follow the repository's patterns.

Verdict: Changes Requested

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/Binius/FRIBinius/Prelude.lean`**

Analysis:
The diff modifies ArkLib/ProofSystem/Binius/FRIBinius/Prelude.lean to:

  1. Add import ArkLib.ProofSystem.RingSwitching.BBFSmallFieldIOPCS.
  2. Add two new typeclass arguments [hβ_lin_indep : Fact (LinearIndependent K β)] and [h_β₀_eq_1 : Fact (β 0 = 1)] to the variable context. These are required by the new call to bbfAbstractOStmtIn.
  3. Replace the explicit definition of BinaryBasefoldAbstractOStmtIn with a call to bbfAbstractOStmtIn from BBFSmallFieldIOPCS, passing the same parameters. This refactors the code to reuse a shared abstraction, avoiding duplication.
  4. Add two new utility definitions bbfSumcheckProfile (a non-reducible wrapper around binaryTowerProfile) and RingSwitching_BBFSumcheckMultParam (a SumcheckMultiplierParam that delegates to RingSwitching_SumcheckMultParam).

The changes are mathematically sound: the new BinaryBasefoldAbstractOStmtIn is equivalent to the old explicit construction (the types align, and BBFSmallFieldIOPCS provides the same AbstractOStmtIn fields). The new typeclass arguments are exactly what bbfAbstractOStmtIn requires, and they are satisfied by the Basis β (a basis is linearly independent, and β 0 = 1 is a new hypothesis that must be supplied by callers, which downstream code already does). The new wrapper definitions are straightforward and consistent with the existing ring‑switching and binary‑basefold framework.

No escape hatches (sorry, axiom, etc.) are introduced. The code compiles without errors. The refactoring improves maintainability by centralising the AbstractOStmtIn construction in BBFSmallFieldIOPCS.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/RingSwitching/BatchingPhase.lean`**

Analysis:
The diff restructures the batching phase to use a ReductionLogicStep architecture, with new pure logic functions, a strict input relation, and a full completeness proof. It also adds soundness components: knowledge state function, extractor, mismatch polynomial, and a Schwartz–Zippel bound. The high-level design is sound and matches the protocol. However, a critical type mismatch is present: the batchingVerifierCheck is defined to return a Prop, but the verifier's guard in oracleVerifier expects a Bool. This would cause a type error. The same pattern appears in the sumcheck phase, but the signature there is also Prop, so the whole project may rely on a custom guard or the signatures are misrepresented. Without tool evidence, it is likely that the code as written is ill-typed. This needs to be corrected to return Bool or the guard must be adapted. Additionally, the completeness proof uses batching_target_consistency with a hypothesis h_msg0 that is not directly used as recorded; the proof appears correct but the reliance on h_msg0 being an equality is subtle. The knowledge soundness proofs are mathematically sound but rely on the existence of prob_schwartz_zippel_mv_polynomial and OracleReduction.rbrKnowledgeSoundness_of_2msg_PtoV_uniformChallenge, which are assumed available. The batchingVerifierCheck returning Prop is the main issue.

Verdict: Changes Requested

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/RingSwitching/BBFSmallFieldIOPCS.lean`**

Analysis:
The file BBFSmallFieldIOPCS.lean is a new module that instantiates the Ring-Switching protocol with Binary Basefold as the inner large-field MLIOPCS, producing a small-field IOPCS. It has two parts:

Part 1: Binary Basefold as MLIOPCS

  • Defines type adapters (reducedMLPEvalStatement_to_BBF_Statement, MLPEvalWitness_to_BBF_Witness) to map between ring-switching output types and Binary Basefold round-0 input types.
  • Defines bbfAbstractOStmtIn as the AbstractOStmtIn for Binary Basefold, with relaxed (UDR-closeness) and strict (exact) compatibility relations, and proofs that strict implies relaxed and that the polynomial is uniquely determined by the oracle.
  • Defines context lenses (largeFieldInvocationStmtLens, largeFieldInvocationCtxLens) for lifting the Binary Basefold reduction to the ring-switching large-field invocation context.
  • Proves largeFieldInvocationCtxLens_complete (completeness of the lens), largeFieldInvocationOracleReduction_perfectCompleteness, and the extractor lens knowledge soundness instance.
  • Constructs bbfMLIOPCS as an MLIOPCS L ℓ' wrapping Binary Basefold.

Part 2: End-to-End Composition

  • Defines bbfProfile as the ring-switching profile for the binary tower.
  • Instantiates sampleability for BBF MLIOPCS challenges.
  • Proves bbf_fullOracleReduction_perfectCompleteness, bbf_fullOracleVerifier_rbrKnowledgeSoundness, and bbf_fullOracleVerifier_knowledgeSoundness by instantiating the generic ring-switching theorems.

Riskiest aspects:

  1. The strictInitialCompatibility_implies_initialCompatibility proof uses polyToOracleFunc_eq_getFirstOracle and BBF_CodeDistance_eq — need to verify the lemma's hypotheses match.
  2. The sumcheckConsistency_MLPEvalWitness_to_BBF_Witness_of_eval proof is long and involves algebraic manipulations with MLE and eqPolynomial; correctness of the sumcheck identity rewrite is critical.
  3. The MLPEvalRelation_of_round0_local_and_structural lemma constructs a fake statement/witness to bridge the BBF round-0 local/structural conditions back to the MLPEvalRelation; the reasoning about BBF_SumcheckMultiplierParam.multpoly dependence on original_claim must be sound.
  4. The largeFieldInvocationExtractorLens_rbr_knowledge_soundness instance's lift_knowledgeSound extracts the BBF round relation and processes the bad-event/good-event case; the MLPEvalRelation recovery uses .symm on the lemma above.
  5. The bbfMLIOPCS.rbrKnowledgeSoundness proof uses OracleVerifier.liftContext_rbr_knowledgeSoundness with appropriate lenses and the inner BBF soundness; type alignment must be exact.

Potential issues found:

  • The strictInitialCompatibility_implies_initialCompatibility proof uses BBF_CodeDistance_eq which is not imported directly; it relies on transitive imports. This is not a bug but a fragility concern.
  • The sumcheckConsistency_MLPEvalWitness_to_BBF_Witness_of_eval lemma substitutes 𝓑 with castEmb using h_Beq derived from h_B01. This is correct but relies on the fact that any embedding of Fin 2 into L sending 0↦0 and 1↦1 is unique. The proof explicitly constructs this equality, which is fine.
  • The MLPEvalRelation_of_round0_local_and_structural lemma assumes that BBF_SumcheckMultiplierParam.multpoly does not depend on the original_claim field of the context. From the repository, BBF_SumcheckMultiplierParam delegates to RingSwitching_SumcheckMultParam whose multpoly is compute_A_MLE, which depends only on t_eval_point and r_batching. So this is correct.
  • No escape hatches (sorry, axiom, native_decide, etc.) are used.
  • The bbfProfile definition is intentionally non-reducible to avoid instance synthesis issues; this is well-documented.

Conclusion: The code appears mathematically correct and follows the established patterns in the repository. No critical misformalizations or Lean issues were found. The code is new, so there are no diff-specific issues to flag.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/RingSwitching/General.lean`**

Analysis:
The diff modifies the perfect completeness and round-by-round knowledge soundness lemmas for the full ring-switching protocol. The changes are: (1) adding missing hypotheses [IsDomain K] [IsDomain L] and (hInit : NeverFail init) to batchingCore_perfectCompleteness and fullOracleReduction_perfectCompleteness, and passing hInit to the sub-lemmas; (2) switching to strict relations (strictBatchingInputRelation, toStrictRelInput) for perfect completeness; (3) completing the proof of fullOracleVerifier_rbrKnowledgeSoundness by removing the sorry and using the existing mlIOPCS.rbrKnowledgeSoundness lemma and rbrKnowledgeSoundness_of_eq_error. The new code eliminates the unfinished proofs and fixes missing arguments, making the development consistent with the corrected signatures of the sub-lemmas. No new errors or regressions are introduced. The changes are mathematically sound and follow the existing proof patterns.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/RingSwitching/Prelude.lean`**

Analysis:
We review the diff to ArkLib/ProofSystem/RingSwitching/Prelude.lean. The changes introduce several major components:

  1. Algebraic machinery for batching and sumcheck: new private lemmas unpack_pack_id, splitBoolPointEquiv, batchingCheckSummand and _split, eval₂_eqPolynomial_concat, repr_packMLE_eval, zeroOnePoint_eq_coe, embedded_MLP_eval_eq_sum, decompose_embedded_MLP_eval_columns/rows, compute_final_eq_tensor_eq_sum, decompose_compute_final_eq_tensor_columns, compute_A_MLE_eval_eq_final_eq_value, compute_s0_embedded_MLP_eval_eq_sum, batching_target_consistency. These provide the algebraic identities needed to prove correctness of the batching verifier check and the sumcheck consistency.

  2. Strict relations for completeness proofs: addition of strictInitialCompatibility, initialCompatibility_unique fields to AbstractOStmtIn, and corresponding strict master-state and round-relation predicates.

  3. Changes to verification functions: performCheckOriginalEvaluation switches from P.decomposeColumns to P.decomposeRows; compute_s0 and compute_final_eq_value switch from P.decomposeRows to P.decomposeColumns. The comments explain the swap is to align with the intended base‑change conventions (rows vs columns) after a frame swap.

  4. Extension of the binaryTowerProfile instance: adds proofs for the new RingSwitchingProfile fields decomposeColumns_add, decomposeColumns_tmul, decomposeRows_add, decomposeRows_tmul, decomposeColumns_injective.

Riskiest aspects:

  • The proofs of the key algebraic identities rely on the newly added profile laws; a mistake in any of these laws would propagate.
  • The decomposeRows_tmul proof uses Basis.baseChange_repr_tmul. The tool could not find this lemma, raising a possible missing dependency.
  • The swap of decomposeRows/decomposeColumns in the verifier functions is intentional but must be exactly consistent with the corresponding lemmas; any remaining mismatch would break the correctness arguments.

Ambiguities: The comment about the frame swap is clear, but the naming is confusing; however the mathematical intent is well documented.

Checklist mapping: Not applicable (no spec checklist).

Verdict: Changes Requested

Critical Misformalizations:

  • The proof of decomposeRows_tmul in the binaryTowerProfile instance uses Basis.baseChange_repr_tmul, which is not known to the environment. This would cause a compilation failure. (ArkLib/ProofSystem/RingSwitching/Prelude.lean (in the binaryTowerProfileinstance,decomposeRows_tmul field proof)) (confidence: high)
    • Evidence: The lean_check tool reported Basis.baseChange_repr_tmul as an unknown identifier.
    • Suggested fix: If the lemma is missing, it must be defined or imported. The correct lemma is Basis.baseChange_repr_tmul (provable from Basis.baseChange_repr). Alternatively, use Basis.baseChange_repr and Finsupp.smul_single to derive the identity.

Lean 4 / Mathlib Issues:

  • The decomposeRows_tmul proof uses a lemma that may be unavailable; if it is indeed missing, this is a compilation error. The tool's environment may be incomplete, so this might be a false positive. (ArkLib/ProofSystem/RingSwitching/Prelude.lean (binaryTowerProfile instance)) (confidence: low)
    • Evidence: lean_check reported unknown identifier Basis.baseChange_repr_tmul.
    • Suggested fix: Ensure the lemma Basis.baseChange_repr_tmul is imported or defined.

Nitpicks: None

📄 **Review for `ArkLib/ProofSystem/RingSwitching/Profile.lean`**

Analysis:
The diff adds five new Prop-valued fields to the RingSwitchingProfile structure: decomposeColumns_add, decomposeColumns_tmul, decomposeRows_add, decomposeRows_tmul, and decomposeColumns_injective. These fields specify additional algebraic properties of the decomposeColumns and decomposeRows functions that are required by the ring-switching protocols (batching and sumcheck completeness). The properties are stated as universally quantified equations over the relevant types, using the existing basis.repr and the Algebra-induced scalar multiplication. The types are well-formed and the statements are mathematically consistent with the intended semantics (e.g., Binius baseChangeRight.repr). The new fields are compatible with the existing structure and do not break any invariants within the file. The addition is a breaking change for existing instances of the structure, but that is expected and belongs to the PR's broader scope. No escape hatches, typeclass misuses, or mathematical errors are present.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

@github-actions

Copy link
Copy Markdown
Contributor

AI review continued (part 4/4)

📄 **Review for `ArkLib/ProofSystem/RingSwitching/Spec.lean`**

Analysis:
The diff adds several typeclass instances for the batching challenge oracle spec in RingSwitching/Spec.lean. Specifically:

  1. The SampleableType instance for (pSpecBatching ...).Challenge ⟨1, _⟩ is changed from using simp + instSampleableTypeFinFunc to using inferInstanceAs (SampleableType (Fin κ → L)). The comment explains this is to make the instance definitionally the Fin κ → L instance, which helps the round-reducer's $ᵖ notation unify cheaply.
  2. New instances instOracleInterfacePSpecBatchingChallenge, instFintypePSpecBatchingChallengeIdx, instInhabitedPSpecBatchingChallengeIdx, instFintypePSpecBatchingChallenge, instInhabitedPSpecBatchingChallenge, and instIsUniformSpecPSpecBatchingChallenge are added. These provide the necessary OracleInterface, Fintype, Inhabited, and IsUniformSpec instances for the challenge oracle spec [(pSpecBatching ...).Challenge]ₒ.

These instances are required by the VCVio framework for the completeness and soundness proofs of the batching reduction (e.g., unroll_2_message_reduction_perfectCompleteness and probEvent_soundness_goal_unroll_log'). The pattern follows the existing instances for pSpecSumcheckRound and pSpecFinalSumcheck, which already have similar Fintype, Inhabited, and IsUniformSpec instances.

The riskiest aspect is the inferInstanceAs tactic, which requires (pSpecBatching ...).Challenge ⟨1, _⟩ to be definitionally Fin κ → L. The old code used simp to reduce the type, which suggests the type might not be definitionally transparent. However, the PR presumably compiles, so the inferInstanceAs approach works. The Fintype and Inhabited instances for pSpecSumcheckRound use change + infer_instance, which also requires definitional equality, so the new code is consistent with existing patterns.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The inferInstanceAs tactic in the SampleableType instance relies on (pSpecBatching ...).Challenge ⟨1, _⟩ being definitionally Fin κ → L. If the Challenge definition changes to be less transparent, this instance would break. The old code used simp to reduce the type, which would be more robust against such changes. However, the Fintype instance uses inferInstanceAs as well, and the pSpecSumcheckRound instances use change + infer_instance (also requiring definitional equality), so this is consistent with the codebase. (ArkLib/ProofSystem/RingSwitching/Spec.lean:115-117) (confidence: low)
    • Evidence: Spec.lean line ~115-117: | ⟨1, _⟩ => inferInstanceAs (SampleableType (Fin κ → L)). The old code was simp only [Challenge, Fin.isValue, Matrix.cons_val_one, Matrix.cons_val_fin_one]; exact instSampleableTypeFinFunc (α := L). The inferInstanceAs tactic requires definitional equality of the goal type with SampleableType (Fin κ → L), which may not hold if the Challenge definition is made opaque.
📄 **Review for `ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean`**

Analysis:
The diff replaces the old per-round sumcheck wrappers (which were incomplete, with sorry in completeness and knowledge-soundness proofs) with a new ReductionLogicStep-based architecture. The core changes are:

  • Pure logic functions (sumcheckVerifierCheck, sumcheckProverComputeMsg, sumcheckProverWitOut, etc.) that capture the per-round sumcheck step.
  • A ReductionLogicStep (sumcheckStepLogic) that bundles these into a complete logic instance, parameterised by the RingSwitchingProfile and linking to the strictSumcheckRoundRelation.
  • Prover/Verifier implementations (iteratedSumcheckOracleProver, iteratedSumcheckOracleVerifier) that use the logic step.
  • Full completeness proofs (sumcheckStep_is_logic_complete, iteratedSumcheckOracleReduction_perfectCompleteness) that replace the previous sorry blocks.
  • Round-by-round knowledge soundness components: iteratedSumcheckRbrExtractor, iteratedSumcheckKStateProp, iteratedSumcheckKnowledgeStateFunction, and the final iteratedSumcheckOracleVerifier_rbrKnowledgeSoundness theorem.
  • Bridge lemma (mvPoly_fixFirst_eq_bbf_fixFirst) that equates the MvPolynomial.fixFirstVariablesOfMQP with the BinaryBasefold variant, enabling the two projection systems to be used interchangeably.
  • Ring-switching specific projection lemmas (projectToMidSumcheckPolyWithParam_succ_ringswitching, projectToMidSumcheckPolyWithParam_at_last_eval_ringswitching) that adapt the generic BinaryBasefold lemmas to the ring-switching multiplier (combinator X).
  • Final sumcheck step similarly rewritten with ReductionLogicStep, finalSumcheckStepLogic, and full completeness/soundness proofs.
  • Composition theorems (coreInteraction_perfectCompleteness, coreInteraction_rbrKnowledgeSoundness) that chain the sumcheck loop and final step.

Riskiest aspects:

  1. The finalSumcheckRbrExtractor extractOut field is present but the toFun_full proof in finalSumcheckKnowledgeStateFunction relies on dsimp to unfold the extractor and close the witnessStructuralInvariant goal. This is fragile but should be definitional.
  2. The iteratedSumcheckOracleReduction_perfectCompleteness proof is a large, low-level rewriting of probability/support computations. Any mistake in the support analysis could break the proof, but the pattern is lifted from established Binius proofs.
  3. The sumcheckProverWitOut uses BinaryBasefold.projectToNextSumcheckPoly directly, while the witnessStructuralInvariant in the sumcheck relation is stated in terms of projectToMidSumcheckPolyWithParam. The bridge lemma projectToMidSumcheckPolyWithParam_succ_ringswitching is critical to connecting them. The proof of this lemma appears correct.
  4. The boolEmbedding L is used as the hypercube embedding; the file assumes (boolDomain L k).cube = (univ.map (boolEmbedding L)) ^ᶠ k definitionally, which is asserted in the docstring. Any discrepancy could break the sumcheck consistency lemma.

Ambiguities:

  • The WitMLP type is not defined in the provided signatures; it is presumably a structure with a single field t : MultilinearPoly K ℓ. The code uses witOut.t and witOut.t.val; this is consistent with the earlier WitMLP definition in Prelude.lean.
  • The finalSumcheckKStateProp at m=1 includes witnessStructProp which is witnessStructuralInvariant. The toFun_full proof provides this by dsimp; this relies on the extractor's extractOut being definitionally equal to the record construction. In Lean, record fields are not definitionally equal to the projections of the record literal? Actually, { t' := ... , H := ... }.H is definitionally equal to the H field of the literal. So dsimp should reduce the goal to ... = ..., which is rfl. This is fine.

No escape hatches (sorry, axiom, native_decide, etc.) are present in the diff.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The sumcheckStepLogic field hEq is given as fun i => rfl. The hEq is an argument of ReductionLogicStep that states an equality between the protocol’s message/challenge directions and the embedding. The proof rfl is correct, but the binder name i shadows the outer variable i : Fin ℓ'. This is harmless but could be confusing. Consider using a different name, e.g. fun j => rfl. (ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean:sumcheckStepLogic) (confidence: medium)
    • Evidence: In the definition of sumcheckStepLogic, the hEq field is hEq := fun i => rfl. The binder i shadows the section variable i : Fin ℓ'.
  • The finalSumcheckRbrKnowledgeError is defined as (1 : ℝ≥0) / (Fintype.card L). The final sumcheck step has no verifier challenge, so the knowledge error is zero. This definition is never used in the soundness theorem (the rbrKnowledgeError argument is fun _ => finalSumcheckRbrKnowledgeError, but the per-j obligation is vacuous because pSpecFinalSumcheck has no challenge indices). While mathematically correct, it is a dead definition. Consider removing it. (ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean:finalSumcheckRbrKnowledgeError) (confidence: low)
    • Evidence: def finalSumcheckRbrKnowledgeError : ℝ≥0 := (1 : ℝ≥0) / (Fintype.card L). The theorem finalSumcheckOracleVerifier_rbrKnowledgeSoundness uses fun _ => finalSumcheckRbrKnowledgeError but the obligation is vacuous.
  • The roundKnowledgeError abbrev is defined as Sumcheck.Structured.roundKnowledgeError L ℓ i 2. The name roundKnowledgeError is not fully qualified and could clash with other definitions in the repository. Consider using a more specific name like sumcheckRoundKnowledgeError. (ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean:roundKnowledgeError) (confidence: low)
    • Evidence: abbrev roundKnowledgeError (L : Type) [Fintype L] (ℓ : ℕ) (i : Fin ℓ) : NNReal := Sumcheck.Structured.roundKnowledgeError L ℓ i 2
  • The sumcheckStepLogic and finalSumcheckStepLogic are defined as def rather than noncomputable def. The ReductionLogicStep is a Type with no noncomputable requirement, but the surrounding code uses noncomputable for the prover/verifier. Consistency would suggest using noncomputable for these as well, but it's not required. (ArkLib/ProofSystem/RingSwitching/SumcheckPhase.lean:sumcheckStepLogic, finalSumcheckStepLogic) (confidence: low)
    • Evidence: def sumcheckStepLogic and def finalSumcheckStepLogic are not marked noncomputable.

Cluster: Oracle Reduction Framework (high)

Are the new completeness unroll lemmas and the round-by-round knowledge soundness reducers correct and sufficient to support the protocol proofs, and are the casting operations (castInOut, castOutSimple) used safely without introducing type mismatches or weakening the soundness guarantees?

📄 **Review for `ArkLib/OracleReduction/Basic.lean`**

Analysis:
The diff adds a helper function mkVerifierOStmtOut to construct output oracle statements from input oracle statements and the transcript, replacing inline code in OracleVerifier.toVerifier. It also adds two simp lemmas about this function, and a FullTranscript.mk1 constructor with a simp lemma for 1-round protocols. The changes are purely refactoring and additions: they extract common logic into a separate function, simplify the verifier conversion, and complete the family of transcript constructors. No mathematical content is changed; the new function matches the old inline code using simpa and the new mk1 follows the pattern of the existing mk2. There are no escape hatches, no missing hypotheses, and no typeclass violations. The diff does not implicate any second-order issues in this file.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/OracleReduction/Cast.lean`**

Analysis:
The diff adds new generic casting functions (castInOut, castOutSimple) for OracleReduction and OracleVerifier, along with theorems that these casts preserve completeness, perfect completeness, and round-by-round knowledge soundness. The casts use HEq to handle heterogeneous type changes (index types, statement families, instance types). The proofs rely on subst_vars to collapse all equalities into identity, which is mathematically sound. The main risk is whether subst_vars correctly handles HEq hypotheses; the file typechecks, so it does. The new functions are constructed correctly and do not introduce any escape hatches. The old OracleVerifier.cast and cast_toVerifier remain with sorry, but the diff does not change them and the new functions do not rely on them. No violations of the best-practices checklist are evident. The open NNReal addition is harmless.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/OracleReduction/Completeness.lean`**

Analysis:
The file ArkLib/OracleReduction/Completeness.lean is a new addition providing reusable lemmas for proving perfect completeness of oracle reductions and round-by-round knowledge soundness. The code is organized into several sections:

  1. Generic n-message completeness theorem (unroll_n_message_reduction_perfectCompleteness): This bridges the probabilistic definition of perfect completeness to a pure logic form using Prover.runToRound. The proof is a large conv/simp/erw block that manipulates support and probability failure conditions.

  2. Specializations: Lemmas for 0, 1, and 2-message protocols are derived from the generic theorem. These use Fin.induction to unfold runToRound.

  3. Round-by-round knowledge soundness: unroll_rbrKnowledgeSoundness factors the soundness probability bound into a tsum over initial states with a uniform per-state bound. This relies on helper lemmas tsum_mul_le_of_le_of_sum_le_one_nnreal and ENNReal.tsum_mul_le_of_le_of_sum_le_one.

  4. Probability event simplification: Lemmas to eliminate query logs and state tracking from soundness goals, including probEvent_soundness_goal_unroll_log and its variant.

  5. Soundness unrolling: Lemmas to unroll runToRound for specific protocol shapes (1 message P→V, 1 message V→P, 2 messages).

  6. Probability notation conversion: Lemmas to convert between probEvent notation and Pr_ notation, including probOutput_uniformOfFintype_eq_Pr and tsum_uniform_Pr_eq_Pr.

  7. Round-by-round knowledge soundness reducers: rbrKnowledgeSoundness_of_2msg_PtoV_uniformChallenge and _1msg_VtoP_uniformChallenge reduce the soundness property to a single per-transcript "doom bound" over a fresh uniform challenge.

Riskiest aspects:

  • The FullTranscript.mk1 function is defined for ProtocolSpec 1 but appears to be used with ProtocolSpec 2 in soundness_unroll_runToRound_1_P_to_V_pSpec_2 and in the hbound argument of the reducer. This is a potential type mismatch.
  • The tsum_uniform_Pr_eq_Pr lemma uses simp with classical to prove a nontrivial identity about uniform probability. This may be fragile or incomplete.
  • The probOutput_uniformOfFintype_eq_Pr lemma requires [Inhabited L], which may not always be satisfied in all contexts.
  • The probEvent_soundness_goal_unroll_log proof contains simp only at * which is a no-op but may hide missing lemmas.

Ambiguities:

  • The exact type definitions of FullTranscript, Transcript, and FullTranscript.mk1 are not fully visible in the signatures, making it hard to verify the type compatibility of FullTranscript.mk1 with ProtocolSpec 2.
  • The tsum_uniform_Pr_eq_Pr proof relies on simp having sufficient lemmas about the uniform PMF, which is uncertain without seeing the full library.

Mapping to checklist:

  • Typeclass assumptions: The reducers have appropriate typeclass constraints (Fintype, Inhabited, SampleableType).
  • Prop vs Type: All propositions are correctly in Prop.
  • simp lemmas: Some lemmas like tsum_uniform_Pr_eq_Pr use simp in a way that may not be robust.
  • Escape hatches: No sorry, axiom, native_decide, etc. are used.
  • Naming conventions: The naming follows the project conventions.

Verdict: Changes Requested

Critical Misformalizations:

  • The probEvent_soundness_goal_unroll_log proof begins with simp only at * which is a no-op (it simplifies with no lemmas). This is harmless but may indicate an incomplete cleanup or a missing lemma application. (ArkLib/OracleReduction/Completeness.lean: probEvent_soundness_goal_unroll_log proof) (confidence: low)
    • Evidence: Line: simp only at * in the proof of probEvent_soundness_goal_unroll_log.
    • Suggested fix: Remove the simp only at * line if it's truly a no-op, or replace it with a specific simplification if it was intended to do something.

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The tsum_mul_le_of_le_of_sum_le_one_nnreal and ENNReal.tsum_mul_le_of_le_of_sum_le_one lemmas are very similar (one for ℝ≥0, one for ℝ≥0∞). Consider whether one can be derived from the other or if they can be unified with a typeclass approach. (ArkLib/OracleReduction/Completeness.lean: tsum_mul_le_of_le_of_sum_le_one_nnrealandENNReal.tsum_mul_le_of_le_of_sum_le_one``) (confidence: low)
    • Evidence: Both lemmas appear in the RoundByRoundKnowledgeSoundness section with nearly identical proofs.
  • The hbound argument of rbrKnowledgeSoundness_of_2msg_PtoV_uniformChallenge uses rbrExtractionFailureEvent which is defined in RoundByRound.lean. The documentation claims 'a protocol's rbrExtractionFailureEvent-style abbreviation unifies with it by reducibility', but the rbrExtractionFailureEvent is a @[reducible] def that takes many arguments. Users of this lemma will need to ensure their extractor and kSF match the expected shape. (ArkLib/OracleReduction/Completeness.lean: rbrKnowledgeSoundness_of_2msg_PtoV_uniformChallenge docstring) (confidence: low)
    • Evidence: The docstring: 'The ∃ witMid, ¬ kSF … ∧ kSF … doom event is definitionally the failure predicate produced by unroll_rbrKnowledgeSoundness; a protocol's rbrExtractionFailureEvent-style abbreviation unifies with it by reducibility.'
📄 **Review for `ArkLib/OracleReduction/Execution.lean`**

Analysis:
The diff refactors OracleVerifier.run to use the centralized mkVerifierOStmtOut helper (defined in Basic.lean) instead of inline construction of the output oracle statement. This makes OracleVerifier.run definitionally equal to its toVerifier counterpart, which already uses the same helper. Consequently, the proof of OracleVerifier.run_eq_run_verifier is simplified to a straightforward definitional unfolding. The diff then updates downstream proofs (OracleReduction.run_eq_run_reduction, OracleReduction.runWithLog_eq_runWithLog_reduction, OracleReduction.id_run, OracleReduction.id_runWithLog) to use the new definitions and/or more direct unfoldings. The mathematical content of the execution model is unchanged; the changes are purely refactoring and proof simplification.

Riskiest aspects: (1) The proof of OracleVerifier.run_eq_run_verifier uses the unqualified name run in the simp list, which is ambiguous (there are multiple run definitions in scope). While it compiles, it is fragile to namespace changes. (2) The lemma OracleReduction.runWithLog_eq_runWithLog_reduction has a pre-existing naming mismatch: the lemma name says runWithLog but the statement uses run. The diff changes the proof but not the statement, perpetuating the misleading name. (3) Some proofs changed from simp only to simp (without only), which could be fragile if the global simp set changes.

Verdict: Needs Minor Revisions

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The proofs of OracleReduction.run_eq_run_reduction and OracleReduction.runWithLog_eq_runWithLog_reduction changed from simp only to simp (without only). This introduces unnecessary dependency on the global simp set and could break if the simp set changes. (ArkLib/OracleReduction/Execution.lean:472-480 and 483-490) (confidence: low)
    • Evidence: Diff shows simp only [...] replaced by simp [...] in both lemmas.
📄 **Review for `ArkLib/OracleReduction/OracleInterface.lean`**

Analysis:
The diff adds two theorems, neverFails_simOracle and neverFails_simOracle2, to OracleInterface.lean. These theorems assert that the oracle implementations simOracle and simOracle2 never fail (i.e., have zero probability of failure). The proofs are trivial: intro q; infer_instance, relying entirely on typeclass resolution to derive NeverFail from the available instances. The docstrings explain why IsUniformSpec oSpec is required instead of the weaker Fintype/Inhabited — because NeverFail depends on the probability monad structure provided by IsUniformSpec. The added code is mathematically sound: simOracle and simOracle2 are deterministic transcript lookups composed from pure functions and identity oracles, so they cannot fail. The proof thread is simple and idiomatic. No escape hatches, missing hypotheses, or typeclass misuse are present. This is a clean, low-risk addition.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/OracleReduction/Security/Basic.lean`**

Analysis:
The diff adds two theorems to ArkLib/OracleReduction/Security/Basic.lean:

  1. Verifier.soundness_error_mono: If a verifier satisfies soundness with error ε₁, then it also satisfies soundness with any larger error ε₂.
  2. Verifier.knowledgeSoundness_error_mono: The analogous statement for knowledge soundness.

Both theorems are marked @[grind] for automation. The proofs are straightforward: they unfold the respective definitions, apply the hypothesis for ε₁, and then use le_trans with exact_mod_cast hε to lift the inequality from ℝ≥0 to ENNReal (since Pr[...] is ENNReal and the error bounds are ℝ≥0).

Mathematically, these are simple monotonicity properties that are obviously true. The riskiest aspect is the use of exact_mod_cast hε to coerce the ℝ≥0 inequality into ENNReal. This relies on the availability of norm_cast lemmas for ENNReal (specifically ENNReal.coe_le_coe). In a standard Mathlib environment this is fine, but if the project has a custom probability setup the coercion might not be available. However, the existing code already uses ENNReal for probabilities, so this is unlikely to be an issue.

No critical misformalizations, Lean issues, or escape hatches are present. The changes are minimal, correct, and follow established patterns in the file (e.g., completeness_error_mono).

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The proof uses exact_mod_cast hε to lift the inequality from ℝ≥0 to ENNReal. While this is idiomatic and likely works, it is slightly fragile and depends on norm_cast lemmas being present. An explicit exact ENNReal.coe_le_coe.mpr hε would be more robust. (ArkLib/OracleReduction/Security/Basic.lean:267 and :342) (confidence: low)
    • Evidence: The goal at that point is (ε₁ : ENNReal) ≤ (ε₂ : ENNReal). The tactic exact_mod_cast relies on norm_cast to rewrite the goal. In a standard Mathlib environment ENNReal.coe_le_coe is a norm_cast lemma, so this is fine.
📄 **Review for `ArkLib/OracleReduction/Security/RoundByRound.lean`**

Analysis:
The diff introduces two new definitions/theorems in the round-by-round security framework:

  1. rbrExtractionFailureEvent — a @[reducible] Prop that captures the 'bad event' for round-by-round knowledge soundness: there exists a middle witness that fails the knowledge state function at the current round but succeeds at the next round after extraction. This is exactly the event that appears inside the Pr[...] of rbrKnowledgeSoundness, and it is used by the later rbrKnowledgeSoundness_of_2msg_PtoV_uniformChallenge and _1msg_VtoP_uniformChallenge reducers to state per-message soundness bounds. The definition is a clean extraction of a common sub-predicate and is marked @[reducible] to allow seamless syntactic matching in the reducers.

  2. rbrKnowledgeSoundness_of_eq_error (for both Verifier and OracleVerifier) — a theorem stating that if a verifier is RBR knowledge sound with error function ε₁, and ε₂ is pointwise equal to ε₁, then the verifier is also RBR knowledge sound with ε₂. The proof is trivial: unfold the definition, obtain the existential witnesses, and rewrite the error bound using the given equality. The OracleVerifier version simply delegates to the Verifier version via the toVerifier projection.

Mathematically, both additions are correct. The rbrExtractionFailureEvent is precisely the event used in the main definition, and the error-equality lemma is a straightforward consequence of the definition. There are no missing hypotheses, off-by-one errors, or misuses of the type system. The @[reducible] attribute is appropriate for the small predicate. The error-equality lemma uses a pointwise equality of ℝ≥0 functions, and the rw tactic works correctly through the coercion to ENNReal.

From a Lean 4 best-practices standpoint, the definitions follow naming conventions, use appropriate implicit/explicit arguments, and do not introduce any escape hatches (sorry, axiom, etc.). The code is idiomatic and consistent with the surrounding project.

Risks: The only potential subtlety is that rbrExtractionFailureEvent is defined outside the Verifier namespace while the rest of the round-by-round definitions are inside Verifier. However, it is used in the Completeness.lean file (which is in the same library) and the placement is acceptable. The @[reducible] attribute could cause unfolding in some contexts, but that is intended and documented.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

Cluster: Mathematical Foundations (medium)

Do the new mathematical lemmas (AdditiveNTT, coding theory, probability) provide the necessary algebraic and probabilistic infrastructure for the BinaryBasefold soundness proofs, and are they applied correctly without gaps?

📄 **Review for `ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean`**

Analysis:
This is a new file adding the formalization of the Additive NTT algorithm (Algorithm 2 from LCH14, as adapted for FRI‑Binius in DP24). It defines intermediate evaluation domains S⁽ⁱ⁾, quotient maps q⁽ⁱ⁾, vanishing polynomials Ŵₖ⁽ⁱ⁾, novel polynomial bases Xⱼ⁽ⁱ⁾, evaluation polynomials P⁽ⁱ⁾, and then the NTT butterfly stages and the main additiveNTT algorithm. A loop invariant and a final correctness theorem are stated and proved.

Riskiest aspects:

  1. The definition of qMap uses i + 1 where i : Fin r. Since Fin.add wraps modulo r, the map is mathematically undefined at the boundary i = Fin.last (r-1). The downstream lemmas add the hypothesis i + 1 < r, but the definition itself is globally available without that guard.
  2. The helper linear_map_of_comp_to_linear_map_of_eval is used in several critical places (qMap_maps_sDomain, qMap_eval_mem_sDomain_succ, eval_point_ω_eq_next_twiddleFactor_comp_qmap, NTTStage_correctness) but the toolchain reports it as unknown in the AdditiveNTT namespace. This is likely a missing definition or import.
  3. The correctness proof of NTTStage is very long and relies on a large collection of bit‑manipulation lemmas (custom Nat functions) that are not visible in the review context; verifying their correctness mechanically is beyond the scope of this review.
  4. The file uses omit extensively to suppress typeclass arguments; while not a bug, it makes the dependency on hF₂ and h_β₀_eq_1 less transparent.

Mathematical mapping:

  • sDomain → intermediate evaluation domain S⁽ⁱ⁾
  • qMap → quotient map q⁽ⁱ⁾
  • intermediateNormVpoly → Ŵₖ⁽ⁱ⁾
  • intermediateNovelBasisX → Xⱼ⁽ⁱ⁾
  • intermediateEvaluationPoly → P⁽ⁱ⁾
  • additiveNTT → Algorithm 2
  • additiveNTT_correctness → Theorem 4.1 (main correctness)

Key missing dependency: linear_map_of_comp_to_linear_map_of_eval is undefined in the AdditiveNTT namespace per the toolchain. This is a blocking compilation error.

Verdict: Changes Requested

Critical Misformalizations:

  • qMap is defined for all Fin r but uses i + 1 (Fin addition) which wraps modulo r. When i = Fin.last (r-1), i + 1 = 0, so the map would evaluate W and β at the wrong indices, making the definition mathematically incorrect. The downstream lemmas add the hypothesis i + 1 < r, but the definition itself is globally available without that guard. (ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean:190) (confidence: high)
    • Evidence: Definition of qMap at line ~190 uses (W 𝔽q β (i + 1)).eval (β (i + 1)). In Fin r, Fin.add is modulo r. The lemma qMap_comp_normalizedW requires h_i_add_1 : i + 1 < r.
    • Suggested fix: Change qMap to take (i : Fin r) and an explicit hypothesis (h : i.val + 1 < r), or change the type to (i : Fin (r-1)).

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The file suppresses many linters (e.g., linter.style.longFile, linter.unusedSectionVars, linter.unusedVariables) via set_option. This is acceptable for a large infrastructure file but should be noted. (ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean:68‑77) (confidence: low)
    • Evidence: Lines 68‑77 of the file.
  • The omit statements (e.g., omit [DecidableEq L] [DecidableEq 𝔽q] h_Fq_char_prime h_β₀_eq_1) are used extensively to suppress typeclass arguments. While not a bug, it makes the dependency on hF₂ and h_β₀_eq_1 less transparent. (ArkLib/Data/FieldTheory/AdditiveNTT/AdditiveNTT.lean:various) (confidence: low)
    • Evidence: Many omit lines throughout the file, e.g., line 100.
📄 **Review for `ArkLib/Data/CodingTheory/Prelims.lean`**

Analysis:
The diff adds three new lemmas about the multilinearWeight function, which computes the tensor-product weight used in Reed–Solomon proximity testing. The lemmas provide a recursive decomposition of the weight for an index of size 2^(ϑ+1) into the weight of the lower ϑ bits (using Fin.init of the randomness vector) multiplied by a factor depending on the highest bit. The multilinearWeight_succ lemma expresses the general splitting; the lower_half and upper_half lemmas specialize it when the high bit is 0 or 1. These lemmas are mathematically correct, relying on standard bitwise properties (Nat.getBit_of_lowBits, Nat.getBit_1_of_ge_two_pow_and_lt_two_pow_succ, Nat.getLowBits_eq_mod_two_pow) from the imported CompPoly.Data.Nat.Bitwise. The proofs are simple rewrites and omega arithmetic. The only minor issue is the addition of import Mathlib.InformationTheory.Hamming, which is not used by the new lemmas and appears unnecessary.

Verdict: Needs Minor Revisions

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • Unused import Mathlib.InformationTheory.Hamming added; the new lemmas do not use any Hamming distance definitions. This import should be removed unless it is required for existing code elsewhere in the file. (ArkLib/Data/CodingTheory/Prelims.lean:10) (confidence: high)
    • Evidence: The diff adds import Mathlib.InformationTheory.Hamming at line 10, but the new lemmas multilinearWeight_succ, multilinearWeight_succ_lower_half, multilinearWeight_succ_upper_half do not reference any Hamming-related definitions.
📄 **Review for `ArkLib/Data/CodingTheory/DivergenceOfSets.lean`**

Analysis:
The diff contains two proof changes in ArkLib/Data/CodingTheory/DivergenceOfSets.lean:

  1. Pr_uniform_equiv proof rewrite: The old proof used simpa with congrArg on a calc block of PMF equalities. The new proof expands the probability notation explicitly via calc with rfl steps at the boundaries and rw for the middle steps. This is mathematically equivalent and more explicit.

  2. hPr_eq in concentration_bounds: The old proof used simp [hfun] to rewrite the probability equality. The new proof uses exact congr_arg (fun f => (do let u ← $ᵖ U; pure (f u)) True) hfun, which applies the function equality hfun to the probability computation. This is more robust than relying on simp to rewrite under the do notation.

Both changes are purely cosmetic/refactoring — they do not alter the mathematical statements or introduce new assumptions. The toolchain confirms the file compiles without errors (the test snippet typechecks). No second-order issues are implicated.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

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

Analysis:
The diff adds a single instance instNontrivial for the Reed-Solomon code submodule, proving that the code is nontrivial (contains a non-zero element) whenever the field F is nontrivial, the index set ι is nonempty and finite, and the degree bound n is nonzero. The proof constructs the constant function 1 using constantCode, uses existing lemmas constantCode_mem_code and constantCode_eq_ofNat_zero_iff to show membership and nonzeroness, and concludes via Subtype.mk_eq_mk. The instance requires [Fintype ι] only for the proof, not the statement, which is acknowledged by suppressing the unusedFintypeInType linter. The mathematics is sound: the constant polynomial C 1 has degree 0, which is strictly less than n (since NeZero n), so its evaluation lies in the code; constantCode_eq_ofNat_zero_iff requires Nonempty ι to ensure the constant function is nonzero when the constant value is nonzero. The instance is correctly conditioned and does not introduce any escape hatches or logical gaps. The Lean implementation is idiomatic and follows best practices. There are no second-order issues — the change does not break any existing invariants or misuse any existing definitions.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The set_option linter.unusedFintypeInType false is slightly unidiomatic; a more principled solution would be to refactor constantCode to avoid the Fintype dependency, but this is out of scope for this diff and the suppression is well-documented. (ArkLib/Data/CodingTheory/ReedSolomon.lean:413-414) (confidence: low)
    • Evidence: ReedSolomon.lean:413-414 — the option is set and immediately consumed by the instance.
📄 **Review for `ArkLib/Data/Fin/BigOperators.lean`**

Analysis:
This PR introduces a new file ArkLib/Data/Fin/BigOperators.lean containing:

  1. Fin helpers: Fin.reindex (reindex vectors via an equivalence), finTwoPowSumEquiv (equivalence between Fin(2^n) ⊕ Fin(2^n) and Fin(2^(n+1))), and splitting/merging helpers for power-of-two sized vectors.
  2. Matrix reindexing lemmas: Matrix.reindex_mulVec, Matrix.mulVec_reindex, Matrix.vecMul_reindex, Matrix.reindex_vecMul, Matrix.reindex_mul_eq_prod_of_reindex, Matrix.reindex_mulVec_reindex, Matrix.reindex_mul_reindex, Matrix.reindex_vecMul_reindex. These relate reindexed matrices and vectors.
  3. Custom block matrix from4Blocks: A definition of a 2×2 block matrix using Fin indices and if conditions, a multiplication lemma Matrix.from4Blocks_mul_from4Blocks, and a lemma Matrix.from4Blocks_eq_fromBlocks linking it to Mathlib's Matrix.fromBlocks via finSumFinEquiv.
  4. Determinant lemmas: Matrix.det_map_ringHom, Matrix.map_neg_ringHom, Matrix.det_fromBlocks_of_squareSubblocks_commute (determinant of [A B; C D] is det(AD - BC) when C and D commute), and Matrix.det_from4Blocks_of_squareSubblocks_commute (wrapper using the previous).
  5. Sum splitting: Fin.sum_univ_odd_even splits a sum over Fin(2^(n+1)) into even- and odd-indexed sums over Fin(2^n).

Risk analysis:

  • The determinant lemma proof is the most complex part and appears to have a critical error: it uses det_fromBlocks_zero₂₁ and det_fromBlocks_zero₁₂ on matrices that do not match the required zero patterns. The lemmas are swapped, making the proof invalid.
  • The block multiplication proof has a comment mismatch (case 2 says "Bottom Row" but should be "Top Row") and uses identical simp blocks for all four cases, which is suspicious and may indicate an incomplete or incorrect proof.
  • Many defs are tagged with @[simp], which is not idiomatic (should be @[simp] on lemmas, not definitions).

Ambiguities: The Fin.reindex name is misleading (it does not depend on Fin). The det_map_ringHom name is non-standard (Mathlib has det_map).

Verdict: Changes Requested

Critical Misformalizations:

  • The proof of Matrix.det_fromBlocks_of_squareSubblocks_commute uses det_fromBlocks_zero₂₁ on R_mat (which has -C' in the bottom-left, not 0) and det_fromBlocks_zero₁₂ on Res_mat (which has B' in the top-right, not 0). The lemmas are swapped; det_fromBlocks_zero₁₂ should be used for R_mat and det_fromBlocks_zero₂₁ for Res_mat. As written, the rewrites do not match the goal, so the proof is invalid. (ArkLib/Data/Fin/BigOperators.lean:437-438) (confidence: high)
    • Evidence: Matrix.det_fromBlocks_zero₂₁ requires the (2,1) block to be 0; R_mat is fromBlocks D_poly 0 (-C') 1 (bottom-left is -C'). Matrix.det_fromBlocks_zero₁₂ requires the (1,2) block to be 0; Res_mat is fromBlocks (A'*D_poly - B'*C') B' 0 D_poly (top-right is B').
    • Suggested fix: Swap the lemmas: use Matrix.det_fromBlocks_zero₁₂ for R_mat and Matrix.det_fromBlocks_zero₂₁ for Res_mat. The rewrite should be rw [Matrix.det_mul, Matrix.det_fromBlocks_zero₁₂, Matrix.det_fromBlocks_zero₂₁] at h_mul.

Lean 4 / Mathlib Issues:

  • Multiple def statements are tagged with @[simp] (Fin.reindex, finTwoPowSumEquiv, finTwoPowAddTwoPowEquiv, splitFinMap_PO2_left, splitFinMap_PO2_right, mergeFinMap_PO2_left_right, reindexVecTwoPowAddTwoPow). The @[simp] attribute is intended for equational lemmas, not for definitions. Tagging a def with @[simp] causes the simplifier to unfold it, which can lead to performance degradation and unintended rewriting. Use abbrev or @[reducible] if unfolding is intended, or remove @[simp] and provide separate @[simp] lemmas. (ArkLib/Data/Fin/BigOperators.lean:various) (confidence: high)
    • Evidence: Lines 20, 25, 42, 51, 55, 59, 63, 89 in the file.
    • Suggested fix: Remove @[simp] from these defs. If the functions are meant to be transparent to the simplifier, consider making them abbrev or @[reducible].

Nitpicks:

  • The name Fin.reindex is misleading; it does not depend on Fin and works for any Fintype. A more appropriate name would be reindex or Function.reindex. (ArkLib/Data/Fin/BigOperators.lean:20) (confidence: low)
    • Evidence: Definition: def Fin.reindex {R n m : Type*} [Fintype n] [Fintype m] (e : n ≃ m) (v : n → R) : m → R := v ∘ e.symm
  • The lemma Matrix.det_map_ringHom has a non-standard name; Mathlib uses Matrix.det_map for the same statement. The suffix _ringHom is unnecessary and may cause confusion. (ArkLib/Data/Fin/BigOperators.lean:395) (confidence: low)
    • Evidence: The lemma is (M.map f).det = f M.det for a ring homomorphism f. Mathlib's Matrix.det_map already exists.
📄 **Review for `ArkLib/Data/Fin/Sigma.lean`**

Analysis:
The diff makes three changes to ArkLib/Data/Fin/Sigma.lean:

  1. Two set_option directives are added near the top of the file to suppress linter warnings about set_option usage and about 'flexible' (set_option in the middle of a file). The comment explains that non-terminal simp in the dflatten/embedSum inductions is intentional, which justifies the linter suppression.

  2. A set_option maxHeartbeats 200000 is added before dflatten_splitSum with a comment noting that the dependent induction is heartbeat-heavy. This is a standard practice when a proof is close to the default heartbeat limit and the increase is modest.

  3. The proof of dflatten_splitSum is completed: the sorry is replaced by an induction on m followed by Fin.addCases on k. The left branch uses simp with dflatten_succ and embedSum_succ_zero; the right branch uses simp with dflatten_succ and embedSum_succ_succ and then applies the induction hypothesis with explicitly provided arguments. The proof is mathematically correct: it follows the structure of dflatten and embedSum, and the induction hypothesis is instantiated with the correct shifted n and motive.

The riskiest aspect is the induction hypothesis instantiation in the right branch, but the explicit arguments (n := n ∘ Fin.succ, motive := fun k => motive (Fin.natAdd (n 0) k), v := fun k => v (Fin.natAdd (n 0) k)) correctly match the goal after simp rewriting. No second-order issues are introduced—the completed lemma is already used by vflatten_splitSum, and the other *_splitSum lemmas that still contain sorry are unchanged by this diff.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/Data/Misc/Basic.lean`**

Analysis:
The diff adds three trivial lemmas to ArkLib/Data/Misc/Basic.lean. fun_eta_expansion and fun_eta_expansion_apply are definitional equalities (rfl) that express eta-equivalence for functions. cast_fun_eq_fun_cast_arg is a standard identity about casting a function along an equality of types; it is proved by funext and subst h. All three are mathematically correct, do not introduce any escape hatches, and follow Lean naming conventions. There are no missing hypotheses, no typeclass issues, and no second-order implications that break existing code.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/Data/MvPolynomial/RestrictDegree.lean`**

Analysis:
The diff adds a single theorem fixFirstVariablesOfMQP_zero_eq to ArkLib/Data/MvPolynomial/RestrictDegree.lean. This theorem states that the fixFirstVariablesOfMQP operation (which fixes the first v variables of a multivariate polynomial to given challenge values) acts as the identity when v = 0 and the challenge vector is empty. The proof proceeds by induction on the polynomial using MvPolynomial.induction_on, handling the constant, addition, and multiplication-by-variable cases. The core computation in the mul_X case shows that the composed equivalence maps X j to X j (modulo a trivial Fin.cast). The proof is mathematically sound and correctly leverages the definitional reduction of ℓ - 0 to to make the types match. There are no escape hatches, missing hypotheses, or typeclass issues. The theorem is a useful basic identity and is placed appropriately in the file.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/Data/Probability/Instances.lean`**

Analysis:
The diff adds several new probability-theoretic and coding-theory lemmas to ArkLib/Data/Probability/Instances.lean. Specifically:

  1. New imports (CompPoly.Data.MvPolynomial.Notation, ArkLib.ToMathlib.MvPolynomial.Equiv, VCVio.EvalDist.Instances.OptionT) and open statements (Polynomial, MvPolynomial, Real). A set_option disables the long-line linter.

  2. Alias prob_mono for the existing monotonicity lemma.

  3. Union bound Pr_or_le: Pr[A ∨ B] ≤ Pr[A] + Pr[B] for any PMF. The proof unfolds to tsums and does a four-case analysis; it is mathematically correct.

  4. Product formula for independent uniform events (prob_pow_of_forall_finFun and its corollary prob_pow_bound_of_forall). The first proves that for uniform sampling on Fin n → A, Pr[∀ i, P(f i)] = (Pr[P a])^n. The second gives a bound when the individual probability is bounded by ε. The proof uses induction, splitting lemmas, and counting arguments; it is mathematically sound.

  5. Schwartz–Zippel lemmas:

    • prob_schwartz_zippel_mv_polynomial (multivariate, total degree bound).
    • prob_schwartz_zippel_univariate_deg (univariate, arbitrary degree bound).
    • prob_poly_agreement_degree_one and prob_poly_agreement_degree_two (probability that two distinct degree-bounded polynomials agree at a random point).
      All correctly apply the standard Schwartz–Zippel bound and convert between ℚ≥0, ℝ≥0, and ENNReal.
  6. Pushforward of uniform distribution (PMF.map_uniformOfFintype_of_fiber_const): if a map has constant-size fibers over its image, the pushforward is the uniform distribution on the image. The proof is correct.

The riskiest aspects are the intricate algebraic manipulations in prob_pow_of_forall_finFun and the degree-bound reasoning in the Schwartz–Zippel lemmas. However, all appear correct under the given assumptions. The main Lean-level concerns are two likely-unused imports/opens (Real, VCVio.EvalDist.Instances.OptionT) and a minor formatting issue (trailing semicolon in Pr_or_le).

Verdict: Needs Minor Revisions

Critical Misformalizations: None

Lean 4 / Mathlib Issues:

  • The import VCVio.EvalDist.Instances.OptionT is added but no OptionT symbols appear in the new code or the rest of the file. This is likely an unused import and should be removed to keep the dependency surface minimal. (ArkLib/Data/Probability/Instances.lean:15) (confidence: medium)
    • Evidence: The diff adds import VCVio.EvalDist.Instances.OptionT (line 15). A search of the full file content reveals no use of OptionT, OptionT.run, OptionT.mk, or any other identifier from that module.
    • Suggested fix: Remove the line import VCVio.EvalDist.Instances.OptionT.

Nitpicks:

  • The proof of Pr_or_le ends with rw [ENNReal.tsum_add]; — a trailing semicolon. While harmless, it is unidiomatic and should be removed. (ArkLib/Data/Probability/Instances.lean:397) (confidence: high)
    • Evidence: Line 397: · rw [ENNReal.tsum_add];
📄 **Review for `ArkLib/ToMathlib/MvPolynomial/Equiv.lean`**

Analysis:
The diff adds a new file ArkLib/ToMathlib/MvPolynomial/Equiv.lean containing two lemmas:

  1. Polynomial.toMvPolynomial_ne_zero_iff: states that toMvPolynomial i preserves non-zero-ness. The proof is mathematically correct and uses the injectivity of toMvPolynomial.

  2. Polynomial.toMvPolynomial_totalDegree_le: states that the total degree of toMvPolynomial p is bounded by natDegree p. The proof attempts to expand p as a sum of monomials and bound each term. However, the proof contains a suspicious rw [← Polynomial.as_sum_support p] after simplifying the monomial term. This rewrite replaces p with its sum representation in the goal, changing the final target from n ≤ p.natDegree to n ≤ (∑ ...).natDegree. The subsequent exact step uses Polynomial.le_natDegree_of_mem_supp n hn, which only provides n ≤ p.natDegree. The types no longer match, so the proof is likely broken (cannot compile). Removing the offending rw line would fix the proof.

Additionally, the imported module CompPoly.ToMathlib.MvPolynomial.Equiv may already declare these lemmas. If so, the new file would cause a duplicate declaration error. The PR must ensure these lemmas are not already present in the dependency.

Verdict: Changes Requested

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ToVCVio/Lemmas.lean`**

Analysis:
The diff adds a new file ArkLib/ToVCVio/Lemmas.lean containing a large collection of helper lemmas for the VCVio probability and simulation framework. The lemmas cover:

  • Support and probability of none in option-valued computations, bridging OptionT failure-freeness to run-level support.
  • OptionT support decomposition for mk, pure, bind, map.
  • Failure probability expansions for OptionT.mk over binds, simulateQ-lifted computations, and liftComp.
  • Support-preservation under liftM and liftComp.
  • StateT unfolding lemmas.
  • forIn loop safety lemmas using invariants and index relations, including path extraction from support.
  • Commutation of simulateQ and liftComp with forIn, Array.mapM, Vector.mapM.
  • Support lemmas for Vector.mapM.
  • StateT bind/map support decomposition.
  • QueryImpl / challengeQueryImpl stateful lemmas.

Mathematically, the lemmas appear correct under the assumptions of the VCVio library. The proofs rely on existing lemmas like probFailure_of_liftM_PMF, OptionT.probFailure_eq, etc. There are no sorry, axiom, or kernel-bypass constructs. The code follows standard Lean 4 practices, uses @[simp] wisely, and is universe-polymorphic.

Potential risk: heavy dependence on probFailure_of_liftM_PMF, which asserts that any computation in a monad lifting to PMF has zero failure probability. This is used to eliminate Pr[⊥ | ...] terms. While the lemma is in the environment, its correctness might be questionable in general, but that is a property of the upstream library rather than this file. The file itself does not introduce new unsoundness.

No critical misformalizations, escape hatches, or serious Lean issues are present. The file is a well-structured addition of utility lemmas.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

📄 **Review for `ArkLib/ToVCVio/Simulation.lean`**

Analysis:
The PR adds a new file ArkLib/ToVCVio/Simulation.lean that provides a large collection of lemmas bridging the VCVio simulation framework (simulateQ, OracleComp, StateT, OptionT) with logical reasoning about protocol execution, support preservation, safety, and probability. The lemmas are organized into sections: probability of none in binds, simulation commutation lemmas, safety preservation lemmas, protocol unrolling (Prover processRound, run_succ, Reduction_run_def), transcript simplification, support preservation under simulation, simOracle2 query unfolding, forIn loop safety and support lemmas, Vector.mapM support, and various helper lemmas about StateT, QueryImpl, and map. The mathematical content is largely about establishing that certain computations never fail (safety) and that their support matches the specification under faithful implementations. The riskiest part is the reliance on the lemma probFailure_of_liftM_PMF which states that any computation in a monad that lifts to PMF has failure probability zero. This is used to prove that OracleComp computations never fail (neverFails_of_simulateQ_stateful) and that simulateQ preserves safety. This is correct only if OracleComp indeed never fails (which is true in the VCVio framework where OracleComp is a free monad without an intrinsic failure constructor). However, the docstrings of several lemmas are misleading, claiming they require additional hypotheses about implementation safety and support when in fact they are immediate consequences of probFailure_of_liftM_PMF. The file also contains a TODO comment that is outdated (the proof of simulateQ_array_mapM is now simple). The overall code is well-structured and follows Lean 4 best practices, with appropriate use of @[simp], variable, and omit.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The docstring of neverFails_of_simulateQ_stateful claims it requires the simulated computation to be safe and the implementation to have the same support, but the proof is simply simp only [probFailure_of_liftM_PMF] and does not use those hypotheses. The docstring is misleading and should be updated to reflect that the lemma is a trivial consequence of probFailure_of_liftM_PMF (i.e., OracleComp never fails). (ArkLib/ToVCVio/Simulation.lean:445-453) (confidence: medium)
    • Evidence: In the full file, the lemma is:
lemma neverFails_of_simulateQ_stateful
    {oSpec : OracleSpec ι} [IsUniformSpec oSpec]
    {α : Type} (oa : OracleComp oSpec α) :
    Pr[⊥ | oa] = 0 := by
  simp only [probFailure_of_liftM_PMF]

The docstring above says "If the simulated stateful computation is safe and the implementation has the same support as the specification, then the original specification computation is safe." This is not reflected in the proof.

  • The docstring of simulateQ_preserves_safety_stateful mentions parameters hImplSafe and hImplSupp that are not present in the lemma's arguments. The proof is also trivial via probFailure_of_liftM_PMF. (ArkLib/ToVCVio/Simulation.lean:428-442) (confidence: medium)
    • Evidence: The lemma signature is:
theorem simulateQ_preserves_safety_stateful
    {oSpec : OracleSpec ι} [IsUniformSpec oSpec] {σ : Type}
    (impl : QueryImpl oSpec (StateT σ ProbComp))
    {α : Type} (oa : OracleComp oSpec α) (s : σ) :
    Pr[⊥ | (simulateQ impl oa).run s] = 0 := by
  simp only [probFailure_of_liftM_PMF]

The docstring refers to hImplSafe and hImplSupp which are not arguments.

  • The TODO comment in the simulateQ_array_mapM lemma mentions that the proof is non-trivial, but the actual proof is now a simple one-liner using Array.mapM_eq_mapM_toList and simulateQ_list_mapM. The comment is outdated and should be removed. (ArkLib/ToVCVio/Simulation.lean:2280) (confidence: low)
    • Evidence: The comment appears just before the lemma:
/-- Distributes `simulateQ` over `Vector.mapM`.

TODO: This proof is non-trivial because ... -/
lemma simulateQ_array_mapM ...
📄 **Review for `ArkLib/ProofSystem/Component/SendClaim.lean`**

Analysis:
The diff replaces trivial with an explicit proof that the two output oracle statements agree. The proof uses OracleVerifier.mkVerifierOStmtOut_inl and OracleVerifier.mkVerifierOStmtOut_inr lemmas to show that both the left and right oracle statements (in the Sum.elim output) are equal to the same forwarded oracle statement oStmt default. This is a correctness improvement: the original trivial was likely closing a goal that was not actually trivial, or the goal structure changed. The change is purely in the proof, not in any definitions or theorem statements. The proof is mathematically sound: both mkVerifierOStmtOut_inl and mkVerifierOStmtOut_inr express that the verifier's output oracle statements are projections of the input oracle statement, and since the SendClaim prover forwards the same statement, they are equal. The rest of the proof (the funext block) is unchanged. The change introduces no new escape hatches, no new axioms, and no new definitions. The proof is idiomatic and uses the provided lemmas correctly. Potential concerns: the mkVerifierOStmtOut_inl and mkVerifierOStmtOut_inr lemmas require specific h proof arguments (rfl and by simp), which may be fragile if the embed definition changes. However, this is a standard pattern in the codebase. No critical misformalizations, no Lean 4 issues, and no nitpicks beyond the inherent fragility of rfl proofs on non-trivial indices.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The proof uses rw with h := rfl and h := by simp which rely on the specific definition of embed. If embed is changed, these proofs would break silently (they would still typecheck if the embed change is compatible, but rfl may not hold). This is a minor fragility concern, not a bug. (ArkLib/ProofSystem/Component/SendClaim.lean:232-234) (confidence: low)
    • Evidence: Lines using OracleVerifier.mkVerifierOStmtOut_inl (j := default) (h := rfl) and OracleVerifier.mkVerifierOStmtOut_inr (j := ⟨0, by simp⟩) (h := rfl)

Cluster: Unclustered files (low)

Review these files independently.

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

Analysis:
The diff adds several new import statements to ArkLib.lean, the top-level re-export file for the ArkLib library. These additions introduce new modules that have been added or moved into the repository. The change is purely administrative: it ensures that the new modules become accessible when import ArkLib is used. There is no mathematical content, no proof, no definition, and no theorem statement in the diff. The added imports are syntactically correct and consistent with the existing import style. There is no evidence of any escape hatches (sorry, axiom, native_decide, etc.) in the diff itself. The diff does not break any existing invariant because it only adds imports; it does not modify any existing code. Therefore, no issues are found.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

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

Analysis:
The diff modifies two proofs in exists_basepoint_with_large_line_prob_aux and exists_basepoint_with_large_line_prob. The changes replace simpa with explicit lemma arguments by simp or exact/rw steps. The mathematical statements are unchanged, so there is no misformalization. The riskiest aspect is the replacement of simpa using prob_tsum_form_split_first ... with simp without specifying the lemma, which could be fragile if the lemma is not a simp lemma. However, the proof compiles, so it is likely harmless. No escape hatches, typeclass issues, or missing hypotheses are introduced.

Verdict: Needs Minor Revisions

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks:

  • The proof of hP2 and hsplit now uses simp without explicitly providing the lemma prob_tsum_form_split_first. This makes the proof less robust: if the lemma is ever removed from the simp set or renamed, the proof will break silently. The original simpa version was explicit and self-documenting. (ArkLib/Data/CodingTheory/ProximityGap/BCIKS20/AffineSpaces.lean: lines around hP2 and hsplit) (confidence: low)
    • Evidence: The diff hunks replace simpa [P2, lineProb] using (prob_tsum_form_split_first ...) with simp [P2, lineProb, prob_tsum_form_split_first] and simpa using (prob_tsum_form_split_first ...) with simp. The latter omits the lemma name entirely.
📄 **Review for `ArkLib/ProofSystem/Binius/BinaryBasefold/Steps.lean`**

Analysis:
The diff replaces the entire content of Steps.lean (which previously contained a monolithic namespace Binius.BinaryBasefold.CoreInteraction with all four step definitions and their properties) with a small umbrella file that imports four new sub‑modules (Steps.Fold, Steps.Commit, Steps.Relay, Steps.FinalSumcheck) and a doc comment explaining that it re‑exports them. The change is purely a structural refactoring: the definitions are moved into separate files, but the namespace is preserved and the definitions remain accessible under the same names. Lean’s typechecker confirms that the imported modules exist and that the old names (e.g., Binius.BinaryBasefold.CoreInteraction.foldOracleProver) are still recognized after importing the new Steps.lean. No mathematical content is added, removed, or altered; the diff introduces no new axioms, sorries, or logical changes. The only risk would be if the sub‑modules omitted necessary open statements or noncomputable sections, but the typechecker’s success indicates that the moved code is well‑formed. Therefore the refactoring is safe and does not introduce any issues.

Verdict: Approved

Critical Misformalizations: None

Lean 4 / Mathlib Issues: None

Nitpicks: None

@alexanderlhicks alexanderlhicks left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this — it is a very large and, in the parts that are yours, a very solid piece of work.
I built it at your pins (clean, 4056 jobs) and ran a full axiom census over all 37 PR-owned
modules (Lean.collectAxioms on every non-internal constant). Headline number:

2,013 axiom-clean declarations / 89 sorryAx-tainted (4.2 %). No sorryAx originates in this
PR.

What is genuinely proved is substantial and I want to be explicit about it:

  • The DP24 soundness core is real and axiom-clean: prop_4_21_bad_event_probability,
    lemma_4_24_dist_folded_ge_of_last_noncompliant, and all of
    Soundness/{BadBlocks,FoldDistance,Incremental,Lift,Proposition4_21,QueryPhasePrelims, QueryPhaseSoundness} (127 decls), QueryPhase (61), Relations (61), ReductionLogic (95).
  • All four per-step reductions (Steps/{Fold,Commit,Relay,FinalSumcheck}, 157 decls) are clean,
    with real extractors — foldRbrExtractor reconstructs the mid-round witness via
    projectToMidSumcheckPoly/getMidCodewords, it is not a constant or default.
  • Both concrete bounds match DP24 §5.2 eq. (43) exactly (checked against the paper, below).
  • The relations are not vacuous: incrementalFoldingBadEvent_of_k_eq_0_is_false
    (Compliance.lean:275) closes the bad-event escape hatch at stmtIdx = 0, and the old
    foldingBadEventAtBlock else True defect is fixed to else False (Relations.lean:262).
  • BatchingPhase (90 decls, clean) resolves both blockers recorded against the generic
    ring-switching scaffold — see the Profile.lean comment.

The blocking items are (1) the PR body's proof claim, (2) the AdditiveNTT/CompPoly duplication,
(3) merge mechanics. Details inline.

On #455 and sequencing. I looked at #455 ("computable FRI-Binius protocols") since it is stacked
on this branch, and I want to be clear that it is not an argument for holding this PR. #455
currently carries 229 sorries with its "Proof migration" box unchecked, while this PR has 0 and
real proofs — blocking proved content behind an unproved refactor would be the wrong ordering. #455
is also 113 commits behind this branch, pins CompPoly v4.28.0 against your v4.30.0, and still uses
the pre-move Binius/RingSwitching/ layout. Its rebase cost grows the longer this sits, so landing
this promptly serves #455 too. Your April framing — checkpoint the security proofs, migrate
gradually — looks right to me and is corroborated rather than undermined by #455's current state.



Better than the CONFLICTING label suggests — 5 conflicting files, not 56:
BinaryBasefold/CoreInteractionPhase.lean, BinaryBasefold/QueryPhase.lean,
BinaryBasefold/Steps.lean, Component/SendClaim.lean, RingSwitching/General.lean.

The toolchain gap is the bigger job: this PR is on leanprover/lean4:v4.30.0 while main is on
v4.31.0, with matching mathlib / VCVio / CompPoly / aesop pin bumps. Expect the Fin-heavy
dependent-cast proofs (Prelude.lean, QueryPhasePrelims.lean) to need attention, and note the 21
already-deprecated lemmas will likely become errors or new warnings across the bump.

Actionable: rebase onto current main and bump to v4.31 in a separate commit from any content
change, so the reviewer can see the bump breakage in isolation.

Landing order. #455 is based on completeness-of-binius, so it inherits whatever happens here.
Once this rebases, #455 will need to rebase onto the new head (or onto main) — it is currently 113
commits, a CompPoly v4.28→v4.30 bump, and the Binius/RingSwitching/RingSwitching/ relocation
adrift. Worth doing that before more work goes into #455, and worth enabling a build check on it:
its last CI run was summarize only, so nothing has compiled it.

@@ -149,18 +155,19 @@ variable {σ : Type} {init : ProbComp σ} {impl : QueryImpl []ₒ (StateT σ Pro

/-- Round-by-round knowledge soundness for the full Binary Basefold oracle verifier -/
theorem fullOracleVerifier_rbrKnowledgeSoundness :

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theorem fullOracleVerifier_rbrKnowledgeSoundness :

Consolidating everything axiom-related into one comment.

#print axioms on this theorem gives [propext, sorryAx, Classical.choice, Quot.sound], and the
same holds for all twelve top-level results across BinaryBasefold/General, FRIBinius/General
and BBFSmallFieldIOPCS. So the PR body's "Status: Fully proved (no sorrys remaining)" holds
for your files but not for these results.

A full census (Lean.collectAxioms over every non-internal constant in the 37 PR-owned modules)
puts it at 2,013 axiom-clean / 89 tainted, with no sorryAx originating in this PR. All
nine origins are pre-existing stubs in main:

Sorry-defined objectsOracleVerifier.append (Composition/Sequential/Append.lean:148,158,
verify field), reached because fullOracleVerifier at line 47 is an append;
OracleVerifier.liftContext (LiftContext/OracleReduction.lean:53,57,58 — all three fields),
reached through the ctx-lens instances; OracleVerifier.cast (Cast.lean:128, verify field).

Sorry-proved theoremsOracleVerifier.append_toVerifier (:191),
Verifier.append_rbrKnowledgeSoundness (:506), OracleReduction.append_{completeness, perfectCompleteness} (:473, :486), Reduction.append_completeness (:439),
Verifier.rbrKnowledgeSoundness_implies_knowledgeSoundness (Security/Implications.lean:102).

A second, independent origin for the scalar-KS theorems.
fullOracleVerifier_knowledgeSoundness (:309, and its FRIBinius/BBFSmallFieldIOPCS
counterparts) additionally routes through rbrKnowledgeSoundness_implies_knowledgeSoundness. So
even if the whole append layer were filled, those three would still be hollow — and they are the
ones a reader is most likely to cite, because they carry the concrete DP24 bound. Worth considering
whether to state them at all until Implications.lean is filled, versus stopping at
rbrKnowledgeSoundness plus fullRbrKnowledgeError_sum_le_concrete, which is the real content and
is untainted by Implications.lean.

Your own Cast.lean additions are clean, and that should be on record: castInOut,
castOutSimple and their four completeness plus two rbrKS compatibility theorems (lines 225–570)
are all axiom-clean. The 8 tainted declarations in that file are the pre-existing cast and the
theorems stated directly about it.

Worth knowing for planning: the ABF26 framework work does not close these. PR #668 removes all
three Security/RoundByRound.lean sorries and adds a sorry-free Security/RbrGame.lean, but
neither it nor #505 touches Append.lean, Implications.lean, LiftContext/ or Cast.lean.

Actionable:

  1. Adjust the PR body — e.g. "all PR-owned files are sorry-free; the top-level composed results
    inherit sorryAx from main's composition layer".
  2. Add a one-line disclosure to the docstring of each of the twelve top-level theorems naming the
    inherited stub.
  3. Nothing for you on the composition layer itself — I have filed
    Sequential-composition and context-lifting layer is stubbed, making composed security theorems vacuous #676
    to track it. 89 declarations in this PR alone are waiting on it,
    which makes it the highest-leverage gap in the library right now, and it is substrate work
    rather than something a protocol PR should carry.

This is not a one-off. PR #503 (LogUp) landed in exactly the same position: LogUp/** sorry-free,
but #print axioms logup_{soundness,completeness} returning sorryAx inherited from the same
family of framework stubs — append_*, the Security/Implications.lean implications, and
liftContext_* — none of which that PR touched either. Two independent protocol formalizations
hitting the identical wall is the argument for prioritising the composition layer over any
individual protocol PR, and for making the #print axioms disclosure a standing convention rather
than something asked for case by case.

Everything below the append layer is clean; none of this touches the mathematics.1

Footnotes

  1. Flagging one asymmetry only because it affects what the docstrings can say: the three
    sorry-defined objects are not in the same position as the sorry-proved lemmas. For the latter,
    "proof pending" is accurate. For the former the statement has no subject yet, so a disclosure
    should say the result is not yet a claim about a constructed verifier rather than that its proof
    is outstanding.

Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chung Thai Nguyen, Quang Dao
-/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import CompPoly.Fields.Binary.AdditiveNTT.NovelPolynomialBasis

This file reinstates a module #307 ("Refactoring CompPoly Out of Arklib") deleted, and re-derives
62 of its 88 declarations from CompPoly modules it does not import — in the same
namespace AdditiveNTT
, i.e. the same qualified names with different signatures. They coexist
only because the two are never imported together; the first consumer needing both hits an
ambiguity wall.

Having gone through it declaration by declaration, though, this is not carelessness and the "with
index changes" in your PR description is not a style preference. Two things came out of the dig:
it works around a real limitation in CompPoly, and the overlap is the residue of parallel
development
. CompPoly gained Domain, Intermediate, Algorithm and Correctness between
v4.28.0 (#455's pin) and v4.30.0 (this PR's pin) — exactly the four modules re-derived here — while
#455 was independently adding an AdditiveNTT/Domain.lean inside ArkLib. Two repos in the same org
built the same layering at the same time. This PR has already partly corrected course by importing
CompPoly's NovelPolynomialBasis, the module #455 still vendors.

Full analysis with numbers is in the review notes; the short version:

The plug-in surface is small. Binius + RingSwitching reference only 28 of this file's 86
declarations (the other 58 are internal scaffolding). Of those 28: 11 are character-identical to
CompPoly
— including sDomain, the hottest at 312 references — accounting for ~80 % of all
usage; 11 are repackaged (dominated by iteratedQuotientMap at 46 refs and
intermediateEvaluationPoly at 27); 6 are genuinely new.

The root cause is that CompPoly uses three index types for one concept:

CompPoly declaration round-index type
sDomain, qMap, sBasis, normalizedW Fin r
intermediateNormVpoly, intermediateNovelBasisX, intermediateEvaluationPoly Fin (ℓ + 1)
iteratedQuotientMap, NTTStage_correctness Fin ℓ

Binius carries Fin r everywhere (sDomain : Fin r → …, β : Fin r → L, OracleStatement is
Fin r-indexed), so each crossing into the polynomial layer means rebuilding ⟨i.val, proof⟩ and
then relating sDomain ⟨i.val, _⟩ back to sDomain i. Your file unifies all three on Fin r plus
a side condition, and passes the destination index explicitly (destIdx + h_destIdx) rather than
computing it in the result type. That is what removes the cast burden.

And one of the differences is a genuine defect, not a preference.
CompPoly.iteratedQuotientMap (i : Fin ℓ) cannot express i = ℓ. Binius needs exactly that:
fiberwiseDisagreementSet (Code.lean:129) is stated with h_destIdx_le : destIdx ≤ ℓ, not <,
and fiberwiseDisagreementSet_steps_zero_eq_disagreementSet instantiates
iteratedQuotientMap (i := destIdx) (k := 0) at that bound; the final fold lands on domain index
exactly . Your (i : Fin r) with i.val + k ≤ ℓ admits it. CompPoly should absorb this
regardless of what happens to this PR.

So the ask here is not "stop duplicating" — it is "please push the fix upstream".

Actionable:

  1. Now, in this PR (one line, unblocks everything else): rename to
    namespace Binius.AdditiveNTT. The same-qualified-name collision is the only part of this that
    is actively dangerous today, and it is independent of any cross-repo work.

  2. The CompPoly side is on me — I have filed AdditiveNTT: unify the round-index type on Fin r, and widen iteratedQuotientMap to admit i = ℓ CompPoly#281. It asks for:
    widening iteratedQuotientMap to Fin r + i.val + k ≤ ℓ with an explicit destIdx
    strictly more general, no consumer breakage; then migrating intermediateNormVpoly /
    intermediateNovelBasisX / intermediateEvaluationPoly from Fin (ℓ+1) to Fin r + i ≤ ℓ
    with deprecated wrappers (one-liners: destIdx := ⟨i+k, _⟩, h_destIdx := rfl). You do not
    need to drive that; please just follow along and say if the proposed signatures would not in
    fact suit Binius.

  3. Then move your 6 new declarations upstream and delete this file. Your proofs already compile,
    so the bulk is a move; the real work is re-basing four spec↔computable bridges
    (computableAdditiveNTT_eq_additiveNTT, computableAdditiveNTTFast_eq_additiveNTT,
    computableNTTStage_eq_NTTStage, computableTwiddleFactor_eq_twiddleFactor).

  4. Independently, and worth double-checking rather than taking from me: consider dropping
    [NeZero ℓ] where it is not needed. Your variable block adds it and CompPoly's does not, and 8
    shared declarations carry it in their elaborated type. Two are clearly vestigial (CompPoly's
    versions take Fin ℓ, which already forces ℓ > 0). For the other six — notably
    additiveNTT_correctness and initial_tiled_coeffs_correctness, whose statements are otherwise
    character-identical to CompPoly's — it looks like a silent narrowing off ℓ = 0.

    Caveat on that: I inferred the six are provable without the hypothesis from the fact that
    CompPoly proves the same statements without it; I did not actually strip it and rebuild. So
    please treat this as "worth a look" rather than a confirmed defect — if one of them genuinely
    needs ℓ > 0, the interesting question is why CompPoly's version does not.

(1 / 2 : ℝ≥0) + 1 / (2 * 2 ^ 𝓡)

/-- Concrete KS upper bound for full FRI-Binius (DP24 §5.2 eq. (43) / Construction 5.1). -/
def concreteFRIBiniusKnowledgeError : ℝ≥0 :=

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def concreteFRIBiniusKnowledgeError : ℝ≥0 :=

Checked against the paper and the arithmetic is faithful — recording that explicitly so it is
not re-litigated. DP24 §5.2 eq. (43) reads

(κ + 2·ℓ')/|L|  +  2^(ℓ'+R)/|L|  +  (1/2 + 1/(2·2^R))^γ

with the paper attributing the summands to ring-switching+sumcheck, Proposition 4.23, and
Proposition 4.24 respectively. This definition matches it term for term, and BinaryBasefold's
concreteBinaryBasefoldKnowledgeError matches it with the κ ring-switching term dropped, exactly
as its docstring states. Prop 4.23's proof gives ≤ 2^{ℓ+R}/|L|, matching the second summand. Good.

The accuracy issue is the notion, not the number. DP24 says: "It follows essentially from the
proofs of Theorems 3.5 and 4.17 that Construction 5.1's concrete soundness error is bounded
from above by (43)." This file states knowledgeSoundness with the same scalars. That is a
strengthening of the cited result, not a transcription of it.

I think the strengthening is defensible — you build genuine RBR extractors per step, so knowledge
soundness is earned rather than assumed — but the justification is your extractor construction,
not Theorems 3.5/4.17. As written, a reader chasing the citation will not find the knowledge claim
in the paper.

Actionable: extend the existing audit note (it already flags this, which is good practice) to
say where the knowledge claim actually comes from — i.e. that each per-round charge is discharged
by an explicit Extractor.RoundByRound in Steps/*, and that DP24 is cited only for the
numerical bound. One or two sentences.

I audited whether the strengthening is legitimate, and it is — with a bonus. ArkLib's
Verifier.rbrKnowledgeSoundness is the averaged notion: the transcript prefix is prover-sampled
and the probability ranges over prefix and challenge together. #668 adds
rbrKnowledgeSoundnessWorstCase and notes in its docstring that worst-case-per-prefix is "the
standard literature shape", and that the averaged form does not imply it. So the notion your
top-level theorems are stated in is weaker than the literature's.

Your proofs, however, discharge the worst-case obligation. Both helpers you route through —
rbrKnowledgeSoundness_of_{2msg_PtoV,1msg_VtoP}_uniformChallenge in your Completeness.lean
(:1228, :1326) — take hbound universally quantified over the statement and the whole
prefix
, with probability over the fresh challenge only. That is exactly
rbrKnowledgeSoundnessWorstCase's inner obligation, and all four per-step results
(Steps/Fold, QueryPhase, BatchingPhase, SumcheckPhase) supply it in that shape. So the
mathematics is at literature strength; only the packaging is the weaker notion, and only because
that is what main currently offers.

Cheap follow-up, once #668 lands: restate the per-step results in
rbrKnowledgeSoundnessWorstCase and get the averaged form from
rbrKnowledgeSoundnessWorstCase_implies_rbrKnowledgeSoundness. You already prove the stronger
hypothesis, so it is close to free and upgrades the advertised guarantee.

One speculation, flagged as such: the unproved append_rbrKnowledgeSoundness may be hard because
the ambient notion is averaged — under composition the second protocol's prefix distribution is
induced by the first's execution, which a worst-case bound survives uniformly and an averaged one
does not obviously. #668 ships both the worst-case notion and the mixture master bounds in
RbrGame.lean, which is the machinery such a proof would want. I have not shown averaged RBR-KS
fails to compose; I mention it because it suggests #668 may be the enabler for the very theorem
this PR is blocked on.


/-- **Column additivity**: `decomposeColumns` is additive in its `A`-argument (it is a genuine
coordinate/`repr` map, not a law-free function). Binius: `map_add` of `baseChangeRight.repr`;
Hachi: linearity of `ψ⁻¹` (Theorem 2, `ψ` linearly homomorphic). -/
decomposeColumns_add : ∀ (z z' : A) (v : Fin κ → Fin 2),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decomposeColumns_add : ∀ (z z' : A) (v : Fin κ → Fin 2),

Credit first, because this is the most valuable non-Binius thing in the PR. The five laws added
here (decomposeColumns_add, decomposeColumns_tmul, decomposeRows_add, decomposeRows_tmul,
decomposeColumns_injective) close the "law-free profile" gap that was raised against the generic
ring-switching scaffold: with only decompose{Rows,Columns}_spec, nothing forced these to be
genuine coordinate maps, and the batching completeness proof could not be closed generically. Your
docstrings give the Binius and Hachi discharge for each, and the laws are load-bearing rather than
decorative — decomposeColumns_injective feeds batchingMismatchPoly_nonzero_of_ne
(BatchingPhase.lean:1034) which feeds the Schwartz–Zippel step of
batchingOracleVerifier_rbrKnowledgeSoundness (:1297). Adding [IsDomain K] [IsDomain L] to the
batching theorems addresses the second recorded blocker. BatchingPhase is 90 declarations, all
axiom-clean (verified by #print axioms).

Also good, and worth stating: this PR does not fork the abstraction. It parameterizes over
RingSwitchingProfile throughout (Spec, General, Prelude, BatchingPhase, SumcheckPhase)
and instantiates via binaryTowerProfile/bbfProfile. That is exactly the intended use.

Worth crediting separately: this PR promotes RingSwitching/* out of
ArkLib/ProofSystem/Binius/RingSwitching/ to top-level ArkLib/ProofSystem/RingSwitching/. That is
the right direction for a profile that Binius and Hachi are both meant to instantiate, and it is
what makes the #615 generalization coherent. (#455 predates the move and still uses the nested
layout — another reason it needs a rebase.)

The coordination problem, which is mine as much as yours. My draft PR #615 is generalizing this
same structure, and the two PRs touch all six RingSwitching/*.lean files — this one adds +4,609
lines there, #615 adds +1,884, and General.lean already conflicts on merge with main. Whoever
lands second faces a substantial and semantic — not textual — reconciliation, because both change
what the profile is required to guarantee.

Actionable: let's settle a landing order before either merges — I'm happy for this one to go
first and to rebase #615 onto it, given this is the PR with the proofs attached. Two things would
help me either way:

  1. Say in the PR body which of the five laws you consider stable API.
  2. Tell me whether you think they survive a generalization. They are stated for the DP24 tensor
    formulation; whether they hold in the form feat: even more general ring switch #615 needs is a design question I would rather answer
    with your input than guess at. If they do not survive as stated, that is worth knowing now,
    because it means the profile needs a different decomposition rather than five more fields.

open scoped NNReal

open Classical in
/-! Definition of the per-round RBR KS error for Binary FoldFold.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- err_SC = 2/|L| (Schwartz-Zippel for degree 1)

The bound is right, the justification in the comment is not. The sumcheck round polynomial here is
L⦃≤ 2⦄[X] (see sumcheckConsistencyProp, Relations.lean:220, which takes
H : L⦃≤ 2⦄[X Fin k]), so this is degree-2 Schwartz–Zippel and 2/|L| is exactly right.
Degree 1 would give 1/|L| and would make the stated error look loose by a factor of two when it
is in fact tight.

Actionable: (Schwartz-Zippel for degree 2).


open scoped NNReal

set_option linter.style.longFile 2600

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set_option linter.style.longFile 2600

This opt-out is below the file's actual length (2,868 lines), so the linter still fires. The build
log shows eight PR files over the 1,500-line cap:

file lines opt-out
BinaryBasefold/QueryPhase.lean 2,882 none
BinaryBasefold/CoreInteractionPhase.lean 2,868 2600 — too low
BinaryBasefold/Prelude.lean 2,857 none
ToVCVio/Simulation.lean 2,485 none
BinaryBasefold/Basic.lean 1,936 none
BinaryBasefold/Steps/FinalSumcheck.lean 1,924 none
BinaryBasefold/Soundness/QueryPhaseSoundness.lean 1,837 none
BinaryBasefold/Steps/Fold.lean 1,763 none

Alongside these, the build emits on PR-owned files: 280 lines over the 100-character limit,
263 unused simp arguments, 116 unused auto-bound section variables, 95 flexible-tactic
warnings, 21 deprecated-lemma uses (e.g. Fin.lt_iff_val_lt_valFin.lt_def at
QueryPhaseSoundness.lean:1521), 14 maxHeartbeats bumps without the required explanatory
comment, and 12 uses of a tactic the linter says should only mark intermediate goal states.

None of this is a correctness concern, and CI passes because these are warnings. But
CLAUDE.md/AGENTS.md set the 1500 cap as the norm and the repo asks for justified opt-outs.

Actionable: prefer splitting the four ~2.9k files along the seams they already have (e.g.
QueryPhase → spec / prelims / soundness) over raising the caps; where a cap is genuinely right,
set it above the real line count and add the one-line justification the linter asks for. The
line-length and unused-simp sweeps are mechanical and would remove ~550 warnings.


@@ -34,6 +37,7 @@ variable (β : Fin r → L) [hβ_lin_indep : Fact (LinearIndependent 𝔽q β)]
[h_β₀_eq_1 : Fact (β 0 = 1)]
variable {ℓ 𝓡 ϑ : ℕ} (γ_repetitions : ℕ) [NeZero ℓ] [NeZero 𝓡] [NeZero ϑ] -- Should we allow ℓ = 0?
variable {h_ℓ_add_R_rate : ℓ + 𝓡 < r} -- ℓ ∈ {1, ..., r-1}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(anchored at line 39; the declaration in question is variable [hdiv : Fact (ϑ ∣ ℓ)] at line 41, which is unchanged by the diff and so not directly commentable.)

variable [hdiv : Fact (ϑ ∣ ℓ)]

DP24 §5.2 is explicit that this hypothesis is dispensable: "This measure further allows us to drop
our assumption ϑ | ℓ′, which we picked up merely for notational convenience in the first place."

Hard-wiring it as a Fact instance means the formalization covers a strictly smaller parameter
range than the paper's Construction 5.1.

That is a perfectly reasonable simplification for a first pass and I would not block on it, but it
should be visible to a reader rather than discovered.

Actionable: note the restriction in the module docstring, with the DP24 §5.2 pointer, and add a
TODO for the early-termination variant that removes it.


@@ -0,0 +1,2484 @@
/-

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2,484 + 839 lines destined for VCVio. Overlap against the pinned VCVio is low — 7 shared
declaration names out of 141 — but I checked each rather than just counting, and two are genuine
redundancies you can drop today:

Redundant — VCVio already has these, more generally:

  • liftComp_self (Lemmas.lean:546) is abbrev liftComp_self [IsUniformSpec spec] (oa) : liftComp oa spec = oa := liftComp_id oa. VCVio proves liftComp_self
    (OracleComp/Coercions/SubSpec.lean:244) with no IsUniformSpec hypothesis. So this is a
    thin alias that is also strictly weaker than the thing it shadows.
  • probFailure_liftComp (Lemmas.lean:488) states Pr[⊥ | liftComp oa superSpec] = Pr[⊥ | oa]
    under [IsUniformSpec spec] [IsUniformSpec superSpec]. VCVio proves the identical statement with
    neither hypothesis (SubSpec.lean:316).

Probably redundant, worth one look: support_bind (Lemmas.lean:198) and
mem_support_bind_iff (:205) are your OptionT-specialised versions of VCVio's
EvalDist/Monad/Basic.lean:112,117, which are already generic in m given
[MonadLiftT m SetM] [LawfulMonadLiftT m SetM]. If OptionT m carries those instances — and
VCVio ships EvalDist/Instances/OptionT.lean — yours should follow from VCVio's directly.

Not a duplicate, and arguably the wrong way round: simulateQ_liftComp. Yours
(Simulation.lean:171) is general in {spec₁ spec₂} with [MonadLift (OracleQuery spec₁) (OracleQuery spec₂)]; VCVio's (QueryTracking/RandomOracle/Simulation.lean:61) is specialised to
the random-oracle hashSpec. Same name, different lemmas — and yours is the more general one, so
it is a good upstream candidate rather than something to delete.

probFailure_liftM I did not compare; VCVio has declarations of that name in both
EvalDist/Instances/ErrorT.lean and .../OptionT.lean.

On upstreaming generally: worth opening the VCVio PR now rather than after merge. The precedent
is concrete and still live — ArkLib/ToVCVio/OracleComp/SimSemantics/SimulateQ.lean was meant to be
deleted once the corresponding VCVio work landed, and it is still sitting on main today. The
longer this material lives in ToVCVio/, the more likely it acquires the same fate.

))
else False

lemma foldingBadEventAtBlock_snoc_castSucc_eq (i : Fin ℓ)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else False

Recording this because it was a known defect and it is now fixed. An earlier audit of the Binius
relations flagged foldingBadEventAtBlock's guard falling through to True, which made
roundRelation i degenerate to for i < ℓ and would have made the RBR knowledge-soundness
statements vacuous. The guard now yields False.

I also checked the remaining vacuity route and it is closed: masterKStateProp is
badEventExists ∨ good, so if badEventExists were satisfiable at stmtIdx = 0 the input relation
would be . It is not — at stmtIdx = 0 the block index gives k = min ϑ 0 = 0, and your
incrementalFoldingBadEvent_of_k_eq_0_is_false (Compliance.lean:275, axiom-clean) proves the
event false there: the close branch compares a set to itself, and the else branch asserts exactly
the negated guard. relIn is therefore the honest good.


(relIn := roundRelation (mp := BBF_SumcheckMultiplierParam) 𝔽q β (ϑ:=ϑ)
(h_ℓ_add_R_rate := h_ℓ_add_R_rate) 0)
(h_ℓ_add_R_rate := h_ℓ_add_R_rate) (𝓑:=𝓑))
(relIn := strictRoundRelation (mp := BBF_SumcheckMultiplierParam) 𝔽q β (ϑ:=ϑ)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(relIn := strictRoundRelation (mp := BBF_SumcheckMultiplierParam) 𝔽q β (ϑ:=ϑ)

Completeness and knowledge soundness for the same protocol are stated over two different input
relations, and nothing in the PR relates them.

  • fullOracleReduction_perfectCompleteness (this line) uses strictRoundRelation … 0
  • fullOracleVerifier_rbrKnowledgeSoundness (:157) uses roundRelation … 0

These are genuinely different definitions. strictRoundRelationProp is
sumCheckConsistency ∧ witnessStructuralInvariant ∧ strictOracleFoldingConsistency, where the
strict clause ties every oracle back to f₀, the encoding of wit.t (Relations.lean:799).
roundRelationProp goes through masterKStateProp, which is
badEventExists ∨ (localChecks ∧ structural ∧ initial ∧ oracleFoldingConsistency) — the non-strict
clause ties consecutive oracles to each other by folding.

I grepped the tree: there is no strictRoundRelation i ⊆ roundRelation i, no equality at 0, and
no bridge lemma of any kind. strictRoundRelation appears only in completeness-side files
(General, ReductionLogic, FRIBinius/CoreInteractionPhase) and roundRelation only on the
soundness side.

Why it matters: as stated, the two theorems do not compose into a security statement. Completeness
holds on the smaller relation and extraction lands in the larger one, so a reader cannot conclude
"if the verifier accepts, the prover knows a witness of the kind completeness assumed" — the two
guarantees are about different sets and the gap between them is unquantified.

I do not think this is a soundness hole. At i = 0 there is exactly one oracle
(toOutCodewordsCount ℓ ϑ 0 = 1), the bad-event disjunct is provably false there (comment 9), and
the relaxed relation's initial clause still pins the first oracle to the encoding of wit.t — so
the extracted witness does look meaningful. But that argument is mine, not the library's, and it
should not have to be reconstructed by a reader.

Actionable: add strictRoundRelation … 0 ⊆ roundRelation … 0 and state the composed guarantee
in the module docstring. I got most of the way there, so here is the skeleton rather than just the
ask — this compiles against your tree with one sorry:

theorem strict_subset_round_zero :
    strictRoundRelation (mp := mp) (𝓑 := 𝓑) 𝔽q β (ϑ := ϑ)
        (h_ℓ_add_R_rate := h_ℓ_add_R_rate) 0
      ⊆ roundRelation (mp := mp) (𝓑 := 𝓑) 𝔽q β (ϑ := ϑ)
        (h_ℓ_add_R_rate := h_ℓ_add_R_rate) 0 := by
  rintro ⟨⟨stmt, oStmt⟩, wit⟩ h
  simp only [strictRoundRelation, strictRoundRelationProp, Set.mem_setOf_eq,
    strictOracleWitnessConsistency] at h
  obtain ⟨hSum, hStruct, hStrictFold⟩ := h
  simp only [roundRelation, roundRelationProp, masterKStateProp, Set.mem_setOf_eq]
  right
  refine ⟨hSum, hStruct, ?_, ?_⟩
  · -- `initial` — the one real obligation, see below
    have hcount : toOutCodewordsCount ℓ ϑ
        (OracleFrontierIndex.mkFromStmtIdx (0 : Fin (ℓ + 1))).val = 1 := by
      rw [OracleFrontierIndex.val_mkFromStmtIdx]; exact toOutCodewordsCountOf0 ℓ ϑ
    have h0 := hStrictFold ⟨0, by omega⟩
    simp only [firstOracleWitnessConsistencyProp, getFirstOracle]
    sorry
  · -- `oracleFoldingConsistencyProp` at i = 0 — vacuous, and this branch is DONE
    intro j hj
    exfalso
    have hcount : toOutCodewordsCount ℓ ϑ
        (OracleFrontierIndex.mkFromStmtIdx (0 : Fin (ℓ + 1))).val = 1 := by
      rw [OracleFrontierIndex.val_mkFromStmtIdx]; exact toOutCodewordsCountOf0 ℓ ϑ
    omega

Two things this establishes. The decomposition is right — right; refine ⟨hSum, hStruct, ?_, ?_⟩
typechecks, so the relaxed relation's localChecks and structural are literally the strict
one's, and only initial and oracleFoldingConsistency need work. And the second branch is
closed: at i = 0 there is one oracle, so oracleFoldingConsistencyProp's j + 1 < count
premise is unsatisfiable.

That leaves initial as the single obligation, and it is mathematically trivial —
hStrictFold at j = 0 says oStmt 0 is f₀ = polyToOracleFunc P₀, the encoding of wit.t,
so the two are at distance 0 and pair_UDRClose reduces to 0 < BBF_CodeDistance 0. What stopped
me is plumbing, not mathematics: reducing steps := 0 * ϑ to 0 so iterated_fold_zero_steps
applies. simp only [zero_mul] will not fire, because the numeral sits in a dependent position
with h_destIdx/h_destIdx_le depending on it, so the motive is ill-typed. You own the
index-congruence idiom for exactly this (sDomain_eq_of_eq, iteratedQuotientMap_congr_k), so
this is a few minutes for you and was not for me.

If the containment turns out to fail rather than merely be fiddly, that is much more interesting
than the lemma and should be documented as a known gap instead.


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.

2 participants