feat: List-based IOP model with composition & sumcheck security proofs#392
feat: List-based IOP model with composition & sumcheck security proofs#392
Conversation
Comprehensive design doc covering the list-based ProtocolSpec refactor, including bundled OracleInterface, coinductive Prover, dual-track Verifier/OracleVerifier, outside challenge sampling, BCS analysis, and FIOP+FC pipeline from eprint 2025/902. Co-authored-by: Cursor <cursoragent@cursor.com>
- HVector: heterogeneous vector ported from lean-mlir with snoc, splitAt, take, drop, and simp lemmas - ProtocolSpec: list-based protocol spec with Round inductive (P_to_V T oi, V_to_P T) bundling OracleInterface; smart constructors .msg/.chal; messageTypes/challengeTypes with append and take lemmas - Transcript: full and partial transcripts as HVector Round.type; Messages/Challenges extraction; PartialTranscript.concat by structural recursion (no casts) Co-authored-by: Cursor <cursoragent@cursor.com>
- Prover: coinductive type with run (outside challenges) and comp (sequential composition via list append); HonestProver wrapper - Verifier: plain verifier seeing messages via full transcript; comp splits transcript at boundary - OracleVerifier: MessageOracleIdx and oracleSpecOfMessages from bundled OracleInterface; oracleImplOfMessages for pure oracle implementation; OracleVerifier structure with verify/simulate/reify; toVerifier bridge (sorry — requires VCVio simulation machinery) - Reduction: plain Reduction and OracleReduction (dual-track); OracleProver with oracle statement data; Proof specialization; Reduction.run; OracleReduction.toReduction (sorry) Co-authored-by: Cursor <cursoragent@cursor.com>
…anup Add security definition files (Defs.lean, StateFunction.lean) with completeness, soundness, knowledge soundness, and round-by-round soundness. Fix build errors across Phase 0/1 files (HVector refactor to recursive def, explicit args for autoImplicit=false, Prover destructuring). Remove all linter warnings (unused simp args, flexible simp tactics). Co-authored-by: Cursor <cursoragent@cursor.com>
…ition) Add sequential composition and n-fold composition for all core types: Prover.iterate, HonestProver.compNth, Verifier.compNth, OracleVerifier.comp/ compNth, Reduction.comp/compNth, OracleReduction.comp/compNth. Add challenge sampling for composed protocols (ofAppend, ofReplicate). Add security composition theorems: completeness composes, perfect completeness composes, RBR soundness implies soundness, n-fold soundness/knowledge soundness. Probability proofs deferred (sorry) pending VCVio infrastructure. Co-authored-by: Cursor <cursoragent@cursor.com>
- Add Prover.mapOutput for mapping prover output types - Add SubSpec instances for oracleSpecOfMessages over append (left/right) - Implement OracleVerifier.toVerifier via answerMsgQuery + simulateQ - Implement OracleVerifier.compNth base case simulate - Implement OracleReduction.toReduction using toVerifier + mapOutput - Fix OracleReduction.compNth base case simulate Remaining sorries: OracleVerifier.comp.verify/simulate (complex cross-spec oracle routing) and 8 composition theorem proofs (need VCVio probability lemmas). Co-authored-by: Cursor <cursoragent@cursor.com>
…Verifier.comp - Rewrite Challenges.split/join and Messages.split/join using structural recursion on pSpec₁, eliminating all rw/simp casts (Eq.mpr) that poisoned downstream definitional equality - Fully implement OracleVerifier.comp verify and simulate fields (were sorry): route queries via SubSpec coercions with continuation mapping (q'.2 <$> liftM (query ...)) to preserve range types - Update callers to pass explicit pSpec₁/pSpec₂ arguments Co-authored-by: Cursor <cursoragent@cursor.com>
Annotate OracleVerifier.comp (query routing strategy, SubSpec continuation pattern), toVerifier (three oracle layers), SubSpec embeddings (left/right index wrapping), Prover.comp, OracleReduction.toReduction, and Challenges/Messages split/join (structural recursion rationale). Co-authored-by: Cursor <cursoragent@cursor.com>
…lSpec Define the Fiat-Shamir transform using structural recursion on the new list-based ProtocolSpec with an accumulator tracking message types. Uses Sum.elim for V_to_P challenge oracle entries so VCVio's SubSpec instances resolve automatically. Includes Prover.runFS, Messages.deriveTranscript, fsProtocolSpec, and the full Reduction.fiatShamir. Made-with: Cursor
- Run prover/verifier/extractor under one shared init per Pr-sample - Tie knowledge-soundness acceptance to the prover's StmtOut - Make FS Messages trivial OracleInterface non-global (avoid instance hazards) - Add OracleVerifier reify/simulate consistency predicate and clarify HVector universes Made-with: Cursor
Introduce a generic oracle-state invariant API and refactor completeness + RBR soundness/KS notions to quantify over initial states satisfying Inv. Update composition theorem statements and the blueprint writeup accordingly. Made-with: Cursor
Switch VCVio to track master and update the Lake manifest lock to 0e91cb33e47b92c41fc1ef0052ca58b0870cedd5. Made-with: Cursor
…ty theorems Define the full general sumcheck protocol in the refactored IOP framework using CompPoly's computable polynomial types (CMvPolynomial for oracle statements, CPolynomial for round messages). New files under ArkLib/Refactor/Sumcheck/: - PolyUtils.lean: OracleInterface instances, CDegreeLE type, CPolynomial bridge lemmas, Lagrange interpolation - Defs.lean: statement types, per-round protocol spec, input relations, computeRoundPoly (evaluate-and-interpolate) - SingleRound.lean: single-round prover, verifier, oracle verifier, reduction - General.lean: multi-round composition via replicate/compNth, multiRoundProver, generalReduction - Security.lean: perfect completeness, single-round soundness (Schwartz-Zippel), multi-round soundness theorem statements (sorry'd proofs) Supporting changes: - HVector: pin PUnit universe to prevent metavariable leaks in compNth - ProtocolSpec: change msg/chal from def to abbrev for instance synthesis - OracleVerifier: add compNth infrastructure Made-with: Cursor
Remove unnecessary `noncomputable` from `computeRoundPoly`, `prover`, `singleRoundReduction`, `multiRoundProver`, and `generalReduction` — all CompPoly operations (eval, lagrange interpolation, field arithmetic) are fully computable. Upgrade Security.lean to use framework-native `rbrSoundness` / `Verifier.soundness` via empty-oracle embedding. Add Test.lean with `native_decide` and `#eval!` tests running the full honest prover + verifier end-to-end over ZMod 7. Made-with: Cursor
Move general-purpose helper lemmas out of the Completeness section and into their proper namespaces following VCVio convention: - probEvent_bind_bind_swap, probEvent_compl_le_of_ge, probEvent_ge_of_compl_le → root-level section ProbEvent - HVector.splitAt_append → root-level namespace HVector - Transcript.split_join → ProtocolSpec.Transcript (before section) - Prover.run_comp_join, run_comp_join_bind → ProtocolSpec.Prover (before section) These lemmas are candidates for upstreaming to VCVio. Made-with: Cursor
Make the multi-round verifier/prover return the sampled challenge vector alongside the final value, so the remaining obligation can live in the reduction output language. Made-with: Cursor
- Invariant.lean: replace unnecessary `simpa` with `simp` at four sites - PolyUtils.lean: replace `show` tactic with `change` to satisfy style linter - Test.lean: suppress `native_decide` linter (intentional for ZMod 7 checks), fix pre-existing parse errors from `|>.value`/`|>.challenges` syntax (wrap in parens), and fix `proverOut.1.value` → `proverOut.value` (`.1` is `.challenges : Vector`, not `.value`) - Composition.lean: add Verifier.StatePreserving / Verifier.OutputIndependent wrappers and oracleFree_* implication lemmas; remove unused _hV₂ parameter from completeness_comp and corollaries Made-with: Cursor
- Add \oSpec macro and remark on sequential composition / non-interference, explaining why P₂ can mutate oracle state before V₁ runs - Rename composition notation from R₂ ∘ R₁ to R₁ comp R₂ to match Lean - Add Definition: oracle-free verifier (sufficient non-interference condition) - Add Lemma: decomposing a composed run under OracleFree assumption (mirrors Lean's run_comp_join_eq_bind) - Rewrite Theorem proof (completeness composes with additive error) to follow the Lean proof structure: stage predicates, challenge re-sampling swap, conditional stage-2 bound, union bound - Add Remark discussing potential weakenings of OracleFree (StatePreserving, OutputIndependent, read-only oracles, commutation hypotheses) - Update n-fold completeness corollary to assume OracleFree and PreservesInv Made-with: Cursor
Remove unnecessary simp/simpa patterns and unused assumptions in Sumcheck security/completeness proofs so `ArkLib/Refactor` is warning-clean except for remaining `sorry` declarations. Made-with: Cursor
Apply the remaining Refactor proof cleanups across composition and sumcheck modules, including style/linter polish and aligned theorem updates, while keeping the workspace warning-clean apart from intentional sorrys. Made-with: Cursor
…ntrypoints Update Refactor security modules to use VCVio's invariant/simulation lemmas, remove local duplicate invariant definitions, and split aggregate imports by introducing ArkLibRefactor as the dedicated Refactor umbrella. Made-with: Cursor
Clean up lints in the composition security file by removing style and unused-argument warnings while preserving the existing theorem placeholders. Made-with: Cursor
…ess, KnowledgeSoundness Split the large Composition.lean into four sub-modules under Composition/ and turn the original file into a re-export hub. Broken proofs are preserved as sorry + block comments for future work. Made-with: Cursor
Progress composition proofs by adding StateT run/map lemmas, wiring RBR knowledge-to-soundness bridge, and restructuring key proof blocks for ongoing completion. Made-with: Cursor
Replace unnecessary `simpa` with `simp`, remove unused simp arguments (`hmid`, `bind_assoc`), and convert non-terminal `simp` to `simp only` in Soundness.lean. Also includes proof fill-ins for StateFunction and KnowledgeSoundness. Made-with: Cursor
…ion and prove single-round sumcheck RBR soundness Refactor knowledge soundness definitions and proofs: - Simplify prover output type from (StmtOut × WitOut) to WitOut in knowledgeSoundness - Project RBR soundness/knowledge soundness distributions to transcript only - Universally quantify rbrKnowledgeSoundness over prover output type - Replace ~400-line direct knowledge soundness proof with short composition (RBR k.s. → RBR soundness → soundness → knowledge soundness) - Drop Inhabited constraints from rbrKnowledgeSoundness_implies_rbrSoundness Add Newton-form fast interpolation with precompiled inverse deltas and prove roundVerifierState_rbrSoundness for single-round sumcheck. Made-with: Cursor
- Add QueryImpl.ofSubSpec: generic SubSpec-to-QueryImpl constructor - Add comp.liftOStmtMsg: shared helper for OStmt+message lifting - Add comp.liftVerify₁, comp.liftVerify₂, comp.liftSimulate as named definitions replacing inline let-bindings in comp - Rewrite comp body using named helpers + OptionT do-notation - Remove duplicate SubSpec.trans (already in VCVio) - Add docstrings to HVector snoc, splitAt, take, drop - Mark probEvent_exists_finset_le_sum for removal after VCVio update Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ration - Add OracleAwareStateFunction and OracleAwareKnowledgeStateFunction with bridge theorems from legacy variants; remove problematic trace variants (OracleAwareTraceStateFunction and friends) whose toFun_next axiom was too restrictive - Add simp lemmas for Transcript.ofMessagesChallenges roundtrips - Make liftFSTail public (needed by StateRestoration) - Add LiftContext module with lens-based lifting for reductions and oracle reductions (WIP, contains sorries) - Add StateRestoration security definitions and bridge theorems (WIP) Made-with: Cursor
… casts Nat.sub uses brecOn internally, so (k+1) - (n+1) is NOT definitionally equal to k - n. This caused all rightOfAppend_concat proofs to require painful casts. Fix by parameterizing rightOfAppend with an explicit local index j and proof j + |pSpec₁| = k, eliminating subtraction from the return type entirely. Key changes: - rightOfAppend now takes (h_eq : j + pSpec₁.length = k) instead of (hk : pSpec₁.length ≤ k), returning PartialTranscript pSpec₂ j - rightOfAppend_concat proven sorry-free with no outer cast - leftFullOfAppend_concat and leftOfAppend_concat proven sorry-free - Added oracleFree_compNth, InLangAtChallenges, roundVerifierStateAsOracle_oracleFree, generalVerifierStateAsOracle_oracleFree, rbrSoundnessError_eq_errorReplicate - Scaffolded generalVerifierStateAsOracle_rbrSoundness (3 sorry's remain) Made-with: Cursor
…t warnings Replace manual inductive state-function construction for n-round soundness with the generic `rbrSoundness_compNth` composition lemma. Add `toFun_challenge_of_mem` fields, omit unused section variables. Made-with: Cursor
…on lemmas Add SymbolicPoly witness type and symbolic round/multi-round reductions via compNth. Fill in rbrSoundness_comp proof skeleton with state function construction. Add HVector.take bridge lemmas for transcript split projections. Made-with: Cursor
…undness proof - PartialEval: derive DecidableEq from LawfulBEq via local instance, removing redundant variable and omit annotations; decompose roundPoly_natDegree_le into per-operation degree lemmas - Soundness: extend rbrSoundness_comp proof with case split on Nonempty Inv - Security: add #print axioms for generalVerifier_rbrSoundness Made-with: Cursor
Extract StateFunction construction into `rbrSoundness_comp_sf` and zero-round base case into `rbrSoundness_replicate_zero`. Fix omega linter warnings by replacing with explicit proof terms. Lower all maxHeartbeats from 800K-4M to 300K or default. Made-with: Cursor
…mmas Thread IndividualDegreeLE witness through SymbolicPoly so the symbolic prover preserves degree bounds across rounds. Add partialEvalFirst and roundPoly degree preservation lemmas in PartialEval. Made-with: Cursor
Move foundational definitions and proofs out of Security.lean into their logical homes to improve modularity and reduce file size (~1578 → ~970 lines): - Completeness.lean: trueTarget/trueRoundValue relation lemmas - PartialEval.lean: prefixPoint_spec characterization theorem - General.lean: outputLang, roundStateLang, TrueRoundPolyExists, trueRoundPolyExists_of_ostmt, and language helper lemmas Fix all linter warnings (unused section variables, simpa/simp, unused simp args, empty lines within commands, long lines, file-too-long). Made-with: Cursor
Replace the sorry in distanceLE_mvPolynomial_degreeLE with a complete proof using the Schwartz-Zippel lemma. The bound shows that for two distinct multivariate polynomials with individual degree ≤ d, the number of agreeing evaluation queries is at most |σ| * d * |R|^(|σ| - 1). Also add #print axioms for generalVerifier_rbrSoundness in Security.lean. Made-with: Cursor
🤖 Gemini PR SummaryRefactors the Interactive Oracle Proof (IOP) model within Core Formalization
Sumcheck Implementation
Infrastructure & Tooling
Proof Status &
|
| Metric | Count |
|---|---|
| 📝 Files Changed | 46 |
| ✅ Lines Added | 14802 |
| ❌ Lines Removed | 4 |
Lean Declarations
✏️ **Added:** 388 declaration(s)
def emptyPrefix : Vector R 0inArkLib/Refactor/Telescope/Sumcheck.leantheorem challengeTypes_cons_V_to_P {T : Type} {tl : ProtocolSpec} :inArkLib/Refactor/ProtocolSpec.leandef OracleVerifier {ι : Type} (oSpec : OracleSpec ι)inArkLib/Refactor/Telescope/OracleVerifier.leanlemma PartialTranscript.rightOfAppend_hvector_take_aux {pSpec₁ pSpec₂ : ProtocolSpec}inArkLib/Refactor/Transcript.leandef ofList : ProtocolSpec → ProtocolCtxinArkLib/Refactor/Telescope/Basic.leandef generalVerifier (D : Fin m → R) :inArkLib/Refactor/Sumcheck/General.leantheorem Verifier.soundness_compNthinArkLib/Refactor/Security/Composition/Soundness.leaninstance instMessageDataOracleInterface :inArkLib/Refactor/Telescope/OracleVerifier.leandef pullback {ctx : ProtocolCtx} {Claim : Type} (tree : ClaimTree ctx Claim) :inArkLib/Refactor/Telescope/Basic.leanlemma Reduction.id_perfectCompletenessinArkLib/Refactor/Security/Composition/Completeness.leandef rbrSoundnessError : ChallengeIndex (generalPSpec R deg n) → ℝ≥0inArkLib/Refactor/Sumcheck/Security.leanabbrev chal (T : Type) (bm : BundledMonad) (rest : ProtocolCtxM) : ProtocolCtxMinArkLib/Refactor/Telescope/Basic.leandef PartialTranscript.ofTranscript {pSpec : ProtocolSpec} (tr : Transcript pSpec) :inArkLib/Refactor/Transcript.leandef prefixPoint : ∀ {i n : ℕ}, Vector R i → (Fin n → R) → Fin (n + i) → RinArkLib/Refactor/Sumcheck/PartialEval.leandef lagrangeInterpolate (pts vals : Vector R (n + 1)) : CPolynomial RinArkLib/Refactor/Sumcheck/PolyUtils.leanlemma split_join {pSpec₁ pSpec₂ : ProtocolSpec}inArkLib/Refactor/Transcript.leandef get {α : Type*} {A : α → Type*} :inArkLib/Refactor/HVector.leandef sampleChallenges (pSpec : ProtocolSpec) [ChallengesSampleable pSpec] :inArkLib/Refactor/Security/Defs.leandef subSpec_oracleSpecOfMessages_right :inArkLib/Refactor/OracleVerifier.leandef runWithTranscriptinArkLib/Refactor/Telescope/Reduction.leandef toVerifierinArkLib/Refactor/OracleVerifier.leantheorem sumAllButFirst_monomials_get0_le {deg : ℕ} (D : Fin m → R) (k : ℕ)inArkLib/Refactor/Sumcheck/PartialEval.leandef split :inArkLib/Refactor/Transcript.leantheorem partialEvalFirst_individualDegreeLE {deg : ℕ} (a : R)inArkLib/Refactor/Sumcheck/PartialEval.leandef oracleImplOfMessages :inArkLib/Refactor/OracleVerifier.leandef Prover (m : Type → Type) (Output : Type) : ProtocolSpec → TypeinArkLib/Refactor/Prover.leantheorem trueTarget_push_eq_trueRoundValueinArkLib/Refactor/Sumcheck/Completeness.leandef verifierFrom :inArkLib/Refactor/Telescope/Sumcheck.leandef StateRestorationinArkLib/Refactor/Security/StateRestoration.leandef type : Round → TypeinArkLib/Refactor/ProtocolSpec.leandef verifier (D : Fin m → R) :inArkLib/Refactor/Telescope/Sumcheck.leandef Transcript.truncate : (n : Nat) → (ctx : ProtocolCtx) →inArkLib/Refactor/Telescope/Basic.leandef liftFSTail {ι : Type} (oSpec : OracleSpec ι)inArkLib/Refactor/FiatShamir.leandef PartialTranscript.empty (pSpec : ProtocolSpec) : PartialTranscript pSpec 0inArkLib/Refactor/Transcript.leantheorem messageTypes_nil : messageTypes ([] : ProtocolSpec) = []inArkLib/Refactor/ProtocolSpec.leandef prover {i : ℕ}inArkLib/Refactor/Sumcheck/SingleRound.leantheorem lagrangeInterpolateWithPlan_natDegree (plan : InterpPlan R n)inArkLib/Refactor/Sumcheck/PolyUtils.leantheorem roundPoly_natDegree_le {deg : ℕ} (D : Fin m → R) {k : ℕ}inArkLib/Refactor/Sumcheck/PartialEval.leandef tail {α : Type*} {A : α → Type*} {a : α} {as : List α}inArkLib/Refactor/HVector.leandef IndividualDegreeLE (deg : ℕ) (p : CMvPolynomial n R) : PropinArkLib/Refactor/Sumcheck/PolyUtils.leanlemma run_comp_join_eq_bindinArkLib/Refactor/Security/Composition/Completeness.leandef Verifier.knowledgeSoundness (relIn : Set (StmtIn × WitIn))inArkLib/Refactor/Security/Defs.leantheorem oracleFree_compNth {ι : Type} {oSpec : OracleSpec ι}inArkLib/Refactor/Security/Composition/Util.leandef roundSoundnessError : ℝ≥0inArkLib/Refactor/Sumcheck/Security.leanabbrev Proof (m : Type → Type) (StmtIn WitIn : Type) (pSpec : ProtocolSpec)inArkLib/Refactor/Reduction.leandef map {α : Type*} {A B : α → Type*} (f : ∀ (a : α), A a → B a) :inArkLib/Refactor/HVector.leandef OracleVerifier.liftContextinArkLib/Refactor/LiftContext/OracleReduction.leandef srReplayChallengeAuxinArkLib/Refactor/Security/StateRestoration.leandef id {m : Type → Type} [Monad m] {S W : Type} :inArkLib/Refactor/Reduction.leandef TrueRoundPolyExists (poly : OStmt R deg n) (D : Fin m → R) : PropinArkLib/Refactor/Sumcheck/General.leandef runToRound {m : Type → Type} [Monad m] {Output : Type} :inArkLib/Refactor/Prover.leandef roundVerifierState (D : Fin m → R) :inArkLib/Refactor/Sumcheck/General.leandef messageData : {ctx : ProtocolCtx} → (tr : Transcript ctx) → MessageData trinArkLib/Refactor/Telescope/OracleVerifier.leantheorem roundVerifierState_rbrSoundnessinArkLib/Refactor/Sumcheck/Security.leandef Verifier.liftContext {m : Type → Type} [Monad m]inArkLib/Refactor/LiftContext/Reduction.leantheorem splitAt_append (l₁ l₂ : List α) (v₁ : HVector A l₁) (v₂ : HVector A l₂) :inArkLib/Refactor/HVector.leantheorem liftContext_perfectCompletenessinArkLib/Refactor/LiftContext/Reduction.leantheorem natDegree_add_le' (p q : CPolynomial R) :inArkLib/Refactor/Sumcheck/PolyUtils.leantheorem rbrSoundness_implies_oracleAwareRbrSoundnessinArkLib/Refactor/Security/StateFunction.leaninstance instOracleInterfaceCPolynomial :inArkLib/Refactor/Sumcheck/PolyUtils.leandef Transcript.join :inArkLib/Refactor/Telescope/Basic.leandef Verifier.compNth {m : Type → Type} [Monad m] {S : Type}inArkLib/Refactor/Telescope/Basic.leandef appendLeft (i : ChallengeIndex pSpec₁) : ChallengeIndex (pSpec₁ ++ pSpec₂)inArkLib/Refactor/ProtocolSpec.leandef iterate {m : Type → Type} [Monad m] {S : Type} :inArkLib/Refactor/Prover.leandef join :inArkLib/Refactor/Transcript.leandef StateRestoration.SoundnessinArkLib/Refactor/Security/StateRestoration.leandef trueRoundValue (poly : OStmt R deg n) {i : ℕ}inArkLib/Refactor/Sumcheck/Completeness.leantheorem PartialTranscript.leftFullOfAppend_hvector_take {pSpec₁ pSpec₂ : ProtocolSpec}inArkLib/Refactor/Transcript.leandef HonestProver.liftContext {m : Type → Type} [Monad m]inArkLib/Refactor/LiftContext/Reduction.leantheorem oracleAwareRbrKnowledgeSoundness_implies_knowledgeSoundnessinArkLib/Refactor/Security/Composition/KnowledgeSoundness.leantheorem challengeTypes_cons_P_to_V {T : Type} {oi : OracleInterface T} {tl : ProtocolSpec} :inArkLib/Refactor/ProtocolSpec.leantheorem pullback_isSound {ctx : ProtocolCtx} {Claim : Type}inArkLib/Refactor/Telescope/Basic.leantheorem replicate_succ (n : Nat) (pSpec : ProtocolSpec) :inArkLib/Refactor/ProtocolSpec.leantheorem claimTreeFrom_isSoundinArkLib/Refactor/Telescope/Sumcheck.leandef Reduction.fiatShamir {ι : Type} {oSpec : OracleSpec ι}inArkLib/Refactor/FiatShamir.leandef partialEvalLast (a : R) (p : CMvPolynomial (n + 1) R) : CMvPolynomial n RinArkLib/Refactor/Sumcheck/PartialEval.leantheorem rbrSoundnessError_eq_errorReplicate :inArkLib/Refactor/Sumcheck/Security.leantheorem comp_not_good_of_not_good :inArkLib/Refactor/Telescope/Basic.leantheorem Verifier.oracleAwareRbrSoundness_compNthinArkLib/Refactor/Security/Composition/Soundness.leantheorem stateRestorationSoundness_implies_soundnessinArkLib/Refactor/Security/StateRestoration.leandef mapOutput {m : Type → Type} [Functor m] {A B : Type} (f : A → B) :inArkLib/Refactor/Prover.leandef reifySimulateCorrectinArkLib/Refactor/OracleVerifier.leandef toRight (i : ChallengeIndex (pSpec₁ ++ pSpec₂)) (h : pSpec₁.length ≤ i.1) :inArkLib/Refactor/ProtocolSpec.leandef replicate (ctx : ProtocolCtxM) : Nat → ProtocolCtxMinArkLib/Refactor/Telescope/Basic.leandef soundnessinArkLib/Refactor/Telescope/Security/Defs.leantheorem liftContext_toReduction_comminArkLib/Refactor/LiftContext/OracleReduction.leandef PartialTranscript.rightOfAppendinArkLib/Refactor/Transcript.leandef snoc {α : Type*} {A : α → Type*} {a : α} {as : List α}inArkLib/Refactor/HVector.leanabbrev msg (T : Type) [oi : OracleInterface T] : RoundinArkLib/Refactor/ProtocolSpec.leandef trueTarget (poly : OStmt R deg n) {i : ℕ} (fixed : Vector R i) (D : Fin m → R) : RinArkLib/Refactor/Sumcheck/Completeness.leantheorem rbrSoundness_compinArkLib/Refactor/Security/Composition/Soundness.leandef splitReplicate {pSpec : ProtocolSpec} (n : Nat)inArkLib/Refactor/ProtocolSpec.leandef run {m : Type → Type} [Monad m] {Output : Type} :inArkLib/Refactor/Prover.leandef runinArkLib/Refactor/Telescope/Reduction.leandef Reduction.compatContextinArkLib/Refactor/LiftContext/Reduction.leandef lagrangeBasis (pts : Vector R (n + 1)) (i : Fin (n + 1)) : CPolynomial RinArkLib/Refactor/Sumcheck/PolyUtils.leandef good {ctx : ProtocolCtx} {Claim : Type} : ClaimTree ctx Claim → Claim → PropinArkLib/Refactor/Telescope/Basic.leantheorem PartialTranscript.leftFullOfAppend_concatinArkLib/Refactor/Transcript.leantheorem rbrKnowledgeSoundness_implies_oracleAwareRbrKnowledgeSoundnessinArkLib/Refactor/Security/StateFunction.leantheorem lagrangeInterpolate_natDegree (pts vals : Vector R (n + 1)) :inArkLib/Refactor/Sumcheck/PolyUtils.leantheorem messageTypes_append (p₁ p₂ : ProtocolSpec) :inArkLib/Refactor/ProtocolSpec.leantheorem MessageOracleIdx_cons_P_to_V {T : Type} {oi : OracleInterface T}inArkLib/Refactor/OracleVerifier.leanabbrev FinArkLib/Refactor/Sumcheck/Test.leandef isChallenge : Round → BoolinArkLib/Refactor/ProtocolSpec.leandef isChallenge : ProtocolCtx → BoolinArkLib/Refactor/Telescope/Basic.leandef StateRestoration.KnowledgeSoundnessinArkLib/Refactor/Security/StateRestoration.leantheorem generalVerifier_rbrSoundnessinArkLib/Refactor/Sumcheck/Security.leantheorem MessageOracleIdx_nil : MessageOracleIdx [] = PEmptyinArkLib/Refactor/OracleVerifier.leantheorem liftContext_toVerifier_comminArkLib/Refactor/LiftContext/OracleReduction.leandef challengeCount : ProtocolSpec → NatinArkLib/Refactor/ProtocolSpec.leandef splitPrefix :inArkLib/Refactor/Telescope/Basic.leantheorem outputLang_subset_roundStateLanginArkLib/Refactor/Sumcheck/General.leandef terminalGood {ctx : ProtocolCtx} {Claim : Type} :inArkLib/Refactor/Telescope/Basic.leandef ofCtx (bm : BundledMonad) : ProtocolCtx → ProtocolCtxMinArkLib/Refactor/Telescope/Basic.leandef D : Fin 2 → FinArkLib/Refactor/Sumcheck/Test.leantheorem Verifier.oracleAwareRbrKnowledgeSoundness_compNthinArkLib/Refactor/Security/Composition/KnowledgeSoundness.leandef run {m : Type → Type} [Monad m]inArkLib/Refactor/Telescope/Basic.leandef proverinArkLib/Refactor/Telescope/Sumcheck.leanlemma oracleFree_comp {ι : Type} {oSpec : OracleSpec ι}inArkLib/Refactor/Security/Composition/Util.leandef PartialTranscript.take {pSpec : ProtocolSpec} {n : Nat}inArkLib/Refactor/Transcript.leantheorem Reduction.completeness_compNthinArkLib/Refactor/Security/Composition/Completeness.leanabbrev PartialTranscript (ctx : ProtocolCtx) (n : Nat) : TypeinArkLib/Refactor/Telescope/Basic.leantheorem liftContext_rbrKnowledgeSoundnessinArkLib/Refactor/LiftContext/OracleReduction.leantheorem sumOverLast_eval (D : Fin m → R) (p : CMvPolynomial (n + 1) R) (v : Fin n → R) :inArkLib/Refactor/Sumcheck/PartialEval.leandef Transcript.ofMessagesChallenges :inArkLib/Refactor/Transcript.leandef FSIdx (StmtIn : Type) : List Type → ProtocolSpec → TypeinArkLib/Refactor/FiatShamir.leantheorem inputLang_iff_initState_mem_roundStateLanginArkLib/Refactor/Sumcheck/General.leandef Challenger.comp {m : Type → Type} [Monad m] :inArkLib/Refactor/Telescope/Basic.leandef singleChallenge (T : Type) : ProtocolSpecinArkLib/Refactor/ProtocolSpec.leanlemma get_eq_right (i : Fin (pSpec₁ ++ pSpec₂).length) (h : pSpec₁.length ≤ i.1) :inArkLib/Refactor/ProtocolSpec.leandef lagrangeInterpolateRawFast (pts vals : Vector R (n + 1)) : CPolynomial.Raw RinArkLib/Refactor/Sumcheck/PolyUtils.leanabbrev StmtIninArkLib/Refactor/Sumcheck/Defs.leandef stateRestorationSoundnessinArkLib/Refactor/Security/StateRestoration.leandef oracleImplinArkLib/Refactor/Telescope/OracleVerifier.leantheorem soundness_monoinArkLib/Refactor/Telescope/Security/Composition/Soundness.leandef PartialTranscript.toFull {pSpec : ProtocolSpec}inArkLib/Refactor/Transcript.leandef Proof.completeness (Inv : σ → Prop) (langIn : Set (StmtIn × WitIn))inArkLib/Refactor/Security/Defs.leanlemma run_comp_join_bind {m : Type → Type} [Monad m] [LawfulMonad m]inArkLib/Refactor/Prover.leandef roundPoly (D : Fin m → R) (k : ℕ) (p : CMvPolynomial (k + 1) R) : CPolynomial RinArkLib/Refactor/Sumcheck/PartialEval.leandef toUnivariate (p : CMvPolynomial 1 R) : CPolynomial RinArkLib/Refactor/Sumcheck/PartialEval.leandef comp :inArkLib/Refactor/Telescope/Basic.leanlemma get_eq_left (i : Fin (pSpec₁ ++ pSpec₂).length) (h : i.1 < pSpec₁.length) :inArkLib/Refactor/ProtocolSpec.leandef HonestProver.fiatShamir {ι : Type} {oSpec : OracleSpec ι}inArkLib/Refactor/FiatShamir.leanlemma probEvent_exists_finset_le_suminArkLib/Refactor/Security/Composition/Util.leantheorem messageTypes_cons_V_to_P {T : Type} {tl : ProtocolSpec} :inArkLib/Refactor/ProtocolSpec.leantheorem soundness_of_comp_isSoundinArkLib/Refactor/Telescope/Security/Composition/Soundness.leantheorem PartialTranscript.leftOfAppend_eq_ofTranscript_leftFullOfAppendinArkLib/Refactor/Transcript.leandef partialEvalPrefix : ∀ {i n : ℕ}, Vector R i → CMvPolynomial (n + i) R → CMvPolynomial n RinArkLib/Refactor/Sumcheck/PartialEval.leantheorem roundVerifierStateAsOracle_oracleFree (D : Fin m → R) :inArkLib/Refactor/Sumcheck/Security.leantheorem liftContext_rbrSoundnessinArkLib/Refactor/LiftContext/Reduction.leandef roundStateLang (poly : OStmt R deg n) (D : Fin m → R) :inArkLib/Refactor/Sumcheck/General.leandef toReductioninArkLib/Refactor/Reduction.leandef Verifier.comp {m : Type → Type} [Monad m] {S₁ : Type} :inArkLib/Refactor/Telescope/Basic.leandef StatePreserving {ι : Type} {oSpec : OracleSpec ι} {σ : Type}inArkLib/Refactor/Security/Composition/Util.leandef eval (x : Fin n → R) (p : CMvDegreeLE R n d) : RinArkLib/Refactor/Sumcheck/PolyUtils.leantheorem Reduction.perfectCompleteness_compNthinArkLib/Refactor/Security/Composition/Completeness.leantheorem generalVerifier_soundnessinArkLib/Refactor/Sumcheck/Security.leandef Transcript.split :inArkLib/Refactor/Telescope/Basic.leandef messageTypes : ProtocolSpec → List TypeinArkLib/Refactor/ProtocolSpec.leantheorem PartialTranscript.rightOfAppend_ofTranscript_eq_split_sndinArkLib/Refactor/Transcript.leandef foldl {α : Type*} {A : α → Type*} {β : Type*} (f : ∀ (a : α), β → A a → β) :inArkLib/Refactor/HVector.leandef answerMsgQuery :inArkLib/Refactor/OracleVerifier.leantheorem rbrSoundness_implies_soundnessinArkLib/Refactor/Security/Composition/Soundness.leandef initState (target : R) : RoundState (RinArkLib/Refactor/Sumcheck/General.leandef challengeTypes : ProtocolSpec → List TypeinArkLib/Refactor/ProtocolSpec.leantheorem prefixPoint_spec {i n : ℕ} (fixed : Vector R i) (v : Fin n → R) (x : Fin (n + i)) :inArkLib/Refactor/Sumcheck/PartialEval.leandef MessageData : {ctx : ProtocolCtx} → Transcript ctx → TypeinArkLib/Refactor/Telescope/OracleVerifier.leandef HonestProver (m : Type → Type) (StmtIn WitIn StmtOut WitOut : Type)inArkLib/Refactor/Prover.leandef inputRelation {n m : ℕ} (poly : OStmt R deg n) (D : Fin m → R) : Set (R × Unit)inArkLib/Refactor/Sumcheck/Defs.leantheorem toPoly_add' (p q : CPolynomial R) :inArkLib/Refactor/Sumcheck/PolyUtils.leantheorem PartialTranscript.leftOfAppend_concatinArkLib/Refactor/Transcript.leandef Verifier (m : Type → Type) (StmtIn : Type) (ctx : ProtocolCtxM)inArkLib/Refactor/Telescope/Basic.leandef symbolicGeneralReduction (poly : OStmt R deg n) (D : Fin m → R) :inArkLib/Refactor/Sumcheck/General.leandef ChallengeIndex (pSpec : ProtocolSpec) : TypeinArkLib/Refactor/ProtocolSpec.leandef Terminal : {ctx : ProtocolCtx} → {Claim : Type} →inArkLib/Refactor/Telescope/Basic.leandef outputLang (poly : OStmt R deg n) : Set (RoundState (RinArkLib/Refactor/Sumcheck/General.leandef symbolicRoundHonestProver (D : Fin m → R) :inArkLib/Refactor/Sumcheck/General.leandef transcript : Transcript (generalPSpec F 1 2)inArkLib/Refactor/Sumcheck/Test.leanlemma rightIndexLt (i : Fin (pSpec₁ ++ pSpec₂).length) (h : pSpec₁.length ≤ i.1) :inArkLib/Refactor/ProtocolSpec.leandef take {α : Type*} {A : α → Type*} :inArkLib/Refactor/HVector.leandef id {m : Type → Type} [Monad m]inArkLib/Refactor/Telescope/Reduction.leantheorem toUnivariate_eval (p : CMvPolynomial 1 R) (x : R) :inArkLib/Refactor/Sumcheck/PartialEval.leandef replicate : Nat → ProtocolSpec → ProtocolSpecinArkLib/Refactor/ProtocolSpec.leandef PartialTranscript.concat : (n : Nat) → (ctx : ProtocolCtx) →inArkLib/Refactor/Telescope/Basic.leandef goodTargetFrominArkLib/Refactor/Telescope/Sumcheck.leantheorem lagrangeInterpolate_eval (pts vals : Vector R (n + 1))inArkLib/Refactor/Sumcheck/PolyUtils.leandef append {α : Type*} {A : α → Type*} :inArkLib/Refactor/HVector.leandef roundPoly₁ : CDegreeLE F 1inArkLib/Refactor/Sumcheck/Test.leantheorem trueRoundPolyExists_of_ostmtinArkLib/Refactor/Sumcheck/General.leandef Transcript.toChallenges :inArkLib/Refactor/Transcript.leandef proverFrom :inArkLib/Refactor/Telescope/Sumcheck.leantheorem liftContext_perfectCompletenessinArkLib/Refactor/LiftContext/OracleReduction.leandef lagrangeBasisWithPlan (plan : InterpPlan R n) (i : Fin (n + 1)) : CPolynomial RinArkLib/Refactor/Sumcheck/PolyUtils.leantheorem MessageOracleIdx_cons_V_to_P {T : Type} {tl : ProtocolSpec} :inArkLib/Refactor/OracleVerifier.leandef OracleProver.liftContextinArkLib/Refactor/LiftContext/OracleReduction.leandef toReductioninArkLib/Refactor/Telescope/Reduction.leandef Messages.trivialOracleInterface (pSpec : ProtocolSpec) :inArkLib/Refactor/FiatShamir.leantheorem liftContext_rbrKnowledgeSoundnessinArkLib/Refactor/LiftContext/Reduction.leandef srReplayChallengeinArkLib/Refactor/Security/StateRestoration.leandef symbolicRoundReduction (D : Fin m → R) :inArkLib/Refactor/Sumcheck/General.leandef FirstStageVerifierStepinArkLib/Refactor/Security/Composition/Util.leandef headType : ProtocolCtx → TypeinArkLib/Refactor/Telescope/Basic.leantheorem liftContext_soundnessinArkLib/Refactor/LiftContext/OracleReduction.leandef myPoly : CMvPolynomial 2 FinArkLib/Refactor/Sumcheck/Test.leantheorem liftContext_completenessinArkLib/Refactor/LiftContext/Reduction.leantheorem eval_add' (x : R) (p q : CPolynomial R) :inArkLib/Refactor/Sumcheck/PolyUtils.leantheorem IsSound.bound_terminalProbinArkLib/Refactor/Telescope/Security/Defs.leandef compNth {m : Type → Type} [Monad m] {S W : Type}inArkLib/Refactor/Prover.leandef subSpec_oracleSpecOfMessages_left :inArkLib/Refactor/OracleVerifier.leandef Prover.runFS {ι : Type} {oSpec : OracleSpec ι}inArkLib/Refactor/FiatShamir.leantheorem singleRoundVerifier_accept_of_backendinArkLib/Refactor/Sumcheck/Completeness.leandef Prover : (ctx : ProtocolCtxM) → (Transcript ctx → Type) → TypeinArkLib/Refactor/Telescope/Basic.leandef OracleReduction.liftContextinArkLib/Refactor/LiftContext/OracleReduction.leantheorem messageTypes_take_succ (pSpec : ProtocolSpec) (n : Nat) :inArkLib/Refactor/ProtocolSpec.leandef follow : {ctx : ProtocolCtx} → {Claim : Type} → (tree : ClaimTree ctx Claim) →inArkLib/Refactor/Telescope/Basic.leandef Extractor.Straightline.liftContextinArkLib/Refactor/LiftContext/Reduction.leandef compinArkLib/Refactor/OracleVerifier.leandef CMvDegreeLE (R : Type) [BEq R] [CommSemiring R] [LawfulBEq R] (n d : ℕ)inArkLib/Refactor/Sumcheck/PolyUtils.leantheorem challengeTypes_take_zero (pSpec : ProtocolSpec) :inArkLib/Refactor/ProtocolSpec.leandef toVerifierinArkLib/Refactor/Telescope/OracleVerifier.leandef g₁ : CompPoly.CPolynomial FinArkLib/Refactor/Sumcheck/Test.leaninstance instOracleInterfaceCMvPolynomial :inArkLib/Refactor/Sumcheck/PolyUtils.leandef claimTreeFrominArkLib/Refactor/Telescope/Sumcheck.leandef acceptsFrominArkLib/Refactor/Telescope/Sumcheck.leandef Verifier.compatStatementinArkLib/Refactor/LiftContext/Reduction.leantheorem Transcript.truncate_succ' {T : Type}inArkLib/Refactor/Telescope/Basic.leantheorem PartialTranscript.rightOfAppend_hvector_take {pSpec₁ pSpec₂ : ProtocolSpec}inArkLib/Refactor/Transcript.leantheorem CPolynomial.natDegree_zero_le (d : ℕ) :inArkLib/Refactor/Sumcheck/PartialEval.leandef append (ctx₁ : ProtocolCtxM) (ctx₂ : Transcript ctx₁ → ProtocolCtxM) :inArkLib/Refactor/Telescope/Basic.leantheorem liftContext_knowledgeSoundnessinArkLib/Refactor/LiftContext/OracleReduction.leantheorem generalReduction_perfectCompleteness_of_backend [DecidableEq R]inArkLib/Refactor/Sumcheck/Security.leandef srKnowledgeSoundnessGameinArkLib/Refactor/Security/StateRestoration.leandef Verifier (m : Type → Type) (StmtIn StmtOut : Type) (pSpec : ProtocolSpec)inArkLib/Refactor/Verifier.leanlemma oracleFree_statePreserving {ι : Type} {oSpec : OracleSpec ι} {σ : Type}inArkLib/Refactor/Security/Composition/Util.leandef ProtocolSpecinArkLib/Refactor/ProtocolSpec.leandef evalPoint {i : ℕ} (fixed : Vector R i) (D : Fin m → R)inArkLib/Refactor/Sumcheck/Completeness.leandef oracleAwareRbrSoundness (langIn : Set StmtIn) (langOut : Set StmtOut)inArkLib/Refactor/Security/StateFunction.leantheorem Verifier.knowledgeSoundness_compNthinArkLib/Refactor/Security/Composition/KnowledgeSoundness.leandef getType (pSpec : ProtocolSpec) (i : Fin pSpec.length) : TypeinArkLib/Refactor/ProtocolSpec.leanabbrev chal (T : Type) : RoundinArkLib/Refactor/ProtocolSpec.leantheorem maxPathError_comp :inArkLib/Refactor/Telescope/Basic.leantheorem Reduction.completeness_compinArkLib/Refactor/Security/Composition/Completeness.leantheorem PartialTranscript.rightOfAppend_concatinArkLib/Refactor/Transcript.leandef simOracleSingle {T : Type} [OracleInterface T] (t : T) :inArkLib/Refactor/Telescope/OracleVerifier.leanabbrev OStmt (deg n : ℕ)inArkLib/Refactor/Sumcheck/Defs.leandef errorReplicateinArkLib/Refactor/Security/Composition/Util.leantheorem stateRestorationKnowledgeSoundness_implies_knowledgeSoundnessinArkLib/Refactor/Security/StateRestoration.leantheorem eval_sum' {ι : Type} (x : R) (s : Finset ι) (f : ι → CPolynomial R) :inArkLib/Refactor/Sumcheck/PolyUtils.leandef lagrangeInterpolateWithPlan (plan : InterpPlan R n) (vals : Vector R (n + 1)) :inArkLib/Refactor/Sumcheck/PolyUtils.leandef Verifier.fiatShamir {ι : Type} {oSpec : OracleSpec ι}inArkLib/Refactor/FiatShamir.leandef roundPoly₂ : CDegreeLE F 1inArkLib/Refactor/Sumcheck/Test.leanabbrev srChallengeOracle (StmtIn : Type) (pSpec : ProtocolSpec)inArkLib/Refactor/Security/StateRestoration.leantheorem claimTree_isSoundinArkLib/Refactor/Telescope/Sumcheck.leantheorem PartialTranscript.leftFullOfAppend_ofTranscript_eq_split_fstinArkLib/Refactor/Transcript.leanlemma hvector_take_succ_eq_concat {pSpec : ProtocolSpec}inArkLib/Refactor/Transcript.leandef Transcript : ProtocolCtxM → TypeinArkLib/Refactor/Telescope/Basic.leandef splitAt {α : Type*} {A : α → Type*} :inArkLib/Refactor/HVector.leandef HonestProver (m : Type → Type)inArkLib/Refactor/Telescope/Reduction.leandef nil : Messages ([] : ProtocolSpec)inArkLib/Refactor/Transcript.leandef Transcript.toMessages :inArkLib/Refactor/Transcript.leandef mapOutput :inArkLib/Refactor/Telescope/Basic.leandef errorAppendinArkLib/Refactor/Security/Composition/Util.leandef OracleFree {ι : Type} {oSpec : OracleSpec ι} {SIn SOut : Type} {pSpec : ProtocolSpec}inArkLib/Refactor/Security/Composition/Util.leandef verifier (D : Fin m → R) :inArkLib/Refactor/Sumcheck/SingleRound.leanlemma rightIndexLt' (i : Fin pSpec₂.length) :inArkLib/Refactor/ProtocolSpec.leandef PartialTranscript.leftOfAppendinArkLib/Refactor/Transcript.leandef toStateRestorationKnowledgeSoundnessinArkLib/Refactor/Security/StateRestoration.leantheorem verifierFrom_soundnessinArkLib/Refactor/Telescope/Sumcheck.leandef g₂ : CompPoly.CPolynomial FinArkLib/Refactor/Sumcheck/Test.leandef PartialTranscript.leftFullOfAppendinArkLib/Refactor/Transcript.leandef CDegreeLE (R : Type) [BEq R] [Semiring R] [LawfulBEq R] (d : ℕ)inArkLib/Refactor/Sumcheck/PolyUtils.leantheorem liftContext_completenessinArkLib/Refactor/LiftContext/OracleReduction.leantheorem partialEvalPrefix_individualDegreeLE {deg : ℕ} :inArkLib/Refactor/Sumcheck/PartialEval.leandef splitPrefix {m : Type → Type} [Monad m] {Output : Type} :inArkLib/Refactor/Prover.leantheorem sumAllButFirst_eval (D : Fin m → R) :inArkLib/Refactor/Sumcheck/PartialEval.leantheorem run_mapOutput {m : Type → Type} [Monad m] [LawfulMonad m] {A B : Type} (f : A → B) :inArkLib/Refactor/Prover.leantheorem liftContext_soundnessinArkLib/Refactor/LiftContext/Reduction.leantheorem trueTarget_at_ninArkLib/Refactor/Sumcheck/Completeness.leandef sumAllButFirst (D : Fin m → R) : (k : ℕ) → CMvPolynomial (k + 1) R → CMvPolynomial 1 RinArkLib/Refactor/Sumcheck/PartialEval.leandef appendRight (i : ChallengeIndex pSpec₂) : ChallengeIndex (pSpec₁ ++ pSpec₂)inArkLib/Refactor/ProtocolSpec.leantheorem liftContext_runinArkLib/Refactor/LiftContext/Reduction.leantheorem challengeTypes_take_succ (pSpec : ProtocolSpec) (n : Nat) :inArkLib/Refactor/ProtocolSpec.leandef soundnessError : ℝ≥0inArkLib/Refactor/Sumcheck/Security.leantheorem soundness_of_isSoundinArkLib/Refactor/Telescope/Security/Defs.leandef srImplFromBasicAuxinArkLib/Refactor/Security/StateRestoration.leandef Reduction.perfectCompleteness (Inv : σ → Prop) (relIn : Set (StmtIn × WitIn))inArkLib/Refactor/Security/Defs.leandef rbrKnowledgeSoundnessinArkLib/Refactor/Security/StateFunction.leandef Proof.soundness (langIn : Set StmtIn)inArkLib/Refactor/Security/Defs.leandef comp {m : Type → Type} [Monad m]inArkLib/Refactor/Telescope/Reduction.leantheorem rbrSoundness_compNthinArkLib/Refactor/Security/Composition/Soundness.leandef Reduction.liftContext {m : Type → Type} [Monad m]inArkLib/Refactor/LiftContext/Reduction.leandef singleRoundReduction {i : ℕ}inArkLib/Refactor/Sumcheck/SingleRound.leantheorem bound_terminalProb_compinArkLib/Refactor/Telescope/Security/Composition/Soundness.leandef liftContext :inArkLib/Refactor/LiftContext/Reduction.leandef fsProtocolSpec (pSpec : ProtocolSpec) : ProtocolSpecinArkLib/Refactor/FiatShamir.leandef partialEvalFirst (a : R) (p : CMvPolynomial (n + 1) R) : CMvPolynomial n RinArkLib/Refactor/Sumcheck/PartialEval.leandef computeRoundPoly {n : ℕ} {m : ℕ} {i : ℕ}inArkLib/Refactor/Sumcheck/Defs.leandef comp {m : Type → Type} [Monad m] {S₁ S₂ S₃ : Type}inArkLib/Refactor/Verifier.leandef isMessage : ProtocolCtx → BoolinArkLib/Refactor/Telescope/Basic.leandef compNthinArkLib/Refactor/OracleVerifier.leanlemma run_comp_join {m : Type → Type} [Monad m] [LawfulMonad m]inArkLib/Refactor/Prover.leandef messageCount : ProtocolSpec → NatinArkLib/Refactor/ProtocolSpec.leantheorem generalVerifierStateAsOracle_oracleFree (D : Fin m → R) :inArkLib/Refactor/Sumcheck/Security.leandef oracleAwareRbrKnowledgeSoundnessinArkLib/Refactor/Security/StateFunction.leandef lagrangeInterpolateWithPlanRawFast (plan : InterpPlan R n) (vals : Vector R (n + 1)) :inArkLib/Refactor/Sumcheck/PolyUtils.leandef drop {α : Type*} {A : α → Type*} :inArkLib/Refactor/HVector.leanlemma run_splitPrefix_joininArkLib/Refactor/Prover.leandef Verifier.soundness (langIn : Set StmtIn) (langOut : Set StmtOut)inArkLib/Refactor/Security/Defs.leantheorem trueTarget_at_zeroinArkLib/Refactor/Sumcheck/Completeness.leantheorem verifier_soundnessinArkLib/Refactor/Telescope/Sumcheck.leantheorem Transcript.truncate_succ {T : Type} {oi : OracleInterface T}inArkLib/Refactor/Telescope/Basic.leandef compinArkLib/Refactor/Reduction.leandef MessageOracleIdx : ProtocolSpec → TypeinArkLib/Refactor/OracleVerifier.leantheorem rbrKnowledgeSoundness_implies_rbrSoundnessinArkLib/Refactor/Security/StateFunction.leantheorem replicate_zero (pSpec : ProtocolSpec) : replicate 0 pSpec = []inArkLib/Refactor/ProtocolSpec.leantheorem toUnivariate_natDegree_le {deg : ℕ}inArkLib/Refactor/Sumcheck/PartialEval.leandef Transcript.suffix : (n : Nat) → (ctx : ProtocolCtx) →inArkLib/Refactor/Telescope/Basic.leandef sumOverLast (D : Fin m → R) (p : CMvPolynomial (n + 1) R) : CMvPolynomial n RinArkLib/Refactor/Sumcheck/PartialEval.leantheorem oracleAwareRbrSoundness_implies_soundnessinArkLib/Refactor/Security/Composition/Soundness.leandef roundProverStepinArkLib/Refactor/Sumcheck/General.leanlemma oracleFree_outputIndependent {ι : Type} {oSpec : OracleSpec ι} {σ : Type}inArkLib/Refactor/Security/Composition/Util.leandef nil {α : Type*} {A : α → Type*} : HVector A ([] : List α)inArkLib/Refactor/HVector.leandef srSoundnessGameinArkLib/Refactor/Security/StateRestoration.leandef toStateRestorationSoundnessinArkLib/Refactor/Security/StateRestoration.leantheorem partialEvalPrefix_eval :inArkLib/Refactor/Sumcheck/PartialEval.leantheorem liftContext_knowledgeSoundnessinArkLib/Refactor/LiftContext/Reduction.leandef runWithLoginArkLib/Refactor/Telescope/Reduction.leandef stateRestorationKnowledgeSoundnessinArkLib/Refactor/Security/StateRestoration.leandef rbrSoundness (langIn : Set StmtIn) (langOut : Set StmtOut)inArkLib/Refactor/Security/StateFunction.leandef srInitFromBasicinArkLib/Refactor/Security/StateRestoration.leantheorem PartialTranscript.leftOfAppend_hvector_take {pSpec₁ pSpec₂ : ProtocolSpec}inArkLib/Refactor/Transcript.leandef Challenger : ProtocolCtxM → TypeinArkLib/Refactor/Telescope/Basic.leantheorem Reduction.perfectCompleteness_compinArkLib/Refactor/Security/Composition/Completeness.leandef cons {α : Type*} {A : α → Type*} {a : α} {as : List α}inArkLib/Refactor/HVector.leantheorem liftContext_rbrSoundnessinArkLib/Refactor/LiftContext/OracleReduction.leandef PartialTranscript.aux : Nat → ProtocolCtx → TypeinArkLib/Refactor/Telescope/Basic.leandef comp {m : Type → Type} [Monad m] {S₁ W₁ S₂ W₂ S₃ W₃ : Type}inArkLib/Refactor/Prover.leantheorem sumOverLast_monomials_get0_le {deg : ℕ} (D : Fin m → R)inArkLib/Refactor/Sumcheck/PartialEval.leandef OracleProver {ι : Type} (oSpec : OracleSpec ι)inArkLib/Refactor/Reduction.leanabbrev fsChallengeOracle (StmtIn : Type) (pSpec : ProtocolSpec)inArkLib/Refactor/FiatShamir.leantheorem Transcript.split_join :inArkLib/Refactor/Telescope/Basic.leandef empty : ProtocolSpecinArkLib/Refactor/ProtocolSpec.leandef cons {tl : ProtocolSpec} {r : Round} (val : r.type) (tr : Transcript tl) :inArkLib/Refactor/Transcript.leandef symbolicReductionState (D : Fin m → R) :inArkLib/Refactor/Sumcheck/General.leantheorem IsSound.compinArkLib/Refactor/Telescope/Security/Composition/Soundness.leandef compNthinArkLib/Refactor/Reduction.leantheorem length_challengeTypes (pSpec : ProtocolSpec) :inArkLib/Refactor/ProtocolSpec.leandef Reduction.completeness (Inv : σ → Prop) (relIn : Set (StmtIn × WitIn))inArkLib/Refactor/Security/Defs.leandef fsOracleSpec (StmtIn : Type) : (acc : List Type) → (pSpec : ProtocolSpec) →inArkLib/Refactor/FiatShamir.leandef toOracleAwareinArkLib/Refactor/Security/StateFunction.leandef evalPts : Vector F 2inArkLib/Refactor/Sumcheck/Test.leandef generalReductioninArkLib/Refactor/Sumcheck/General.leandef OracleProver {ι : Type} (oSpec : OracleSpec ι)inArkLib/Refactor/Telescope/Reduction.leandef run {m : Type → Type} [Monad m]inArkLib/Refactor/Reduction.leandef Extractor.Straightline (oSpec : OracleSpec ι) (StmtIn WitIn WitOut : Type)inArkLib/Refactor/Security/Defs.leandef inputLang {n m : ℕ} (poly : OStmt R deg n) (D : Fin m → R) : Set RinArkLib/Refactor/Sumcheck/Defs.leandef oracleImplOfOStmtInMessages {ιₛᵢ : Type} {OStmtIn : ιₛᵢ → Type}inArkLib/Refactor/OracleVerifier.leandef compileInterpPlan (pts : Vector R (n + 1)) : InterpPlan R n whereinArkLib/Refactor/Sumcheck/PolyUtils.leandef singleRoundRbrError : ChallengeIndex (pSpec (RinArkLib/Refactor/Sumcheck/Security.leandef toLeft (i : ChallengeIndex (pSpec₁ ++ pSpec₂)) (h : i.1 < pSpec₁.length) :inArkLib/Refactor/ProtocolSpec.leantheorem partialEvalLast_eval (a : R) (p : CMvPolynomial (n + 1) R) (v : Fin n → R) :inArkLib/Refactor/Sumcheck/PartialEval.leandef singleMessage (T : Type) [oi : OracleInterface T] : ProtocolSpecinArkLib/Refactor/ProtocolSpec.leandef srImplFromBasicinArkLib/Refactor/Security/StateRestoration.leanlemma hvector_take_length_eq {pSpec : ProtocolSpec} (tr : Transcript pSpec) :inArkLib/Refactor/Transcript.leantheorem challengeTypes_nil : challengeTypes ([] : ProtocolSpec) = []inArkLib/Refactor/ProtocolSpec.leandef PartialTranscript.remaining : (n : Nat) → (ctx : ProtocolCtx) →inArkLib/Refactor/Telescope/Basic.leantheorem roundPoly_eval (D : Fin m → R) (k : ℕ) (p : CMvPolynomial (k + 1) R) (x : R) :inArkLib/Refactor/Sumcheck/PartialEval.leanabbrev msg (T : Type) [oi : OracleInterface T] (bm : BundledMonad) (rest : ProtocolCtxM) :inArkLib/Refactor/Telescope/Basic.leantheorem messageTypes_cons_P_to_V {T : Type} {oi : OracleInterface T} {tl : ProtocolSpec} :inArkLib/Refactor/ProtocolSpec.leantheorem messageTypes_take_zero (pSpec : ProtocolSpec) :inArkLib/Refactor/ProtocolSpec.leanlemma leftIndexLt (i : Fin pSpec₁.length) :inArkLib/Refactor/ProtocolSpec.leanlemma oracleFree_compNth_verifier {ι : Type} {oSpec : OracleSpec ι}inArkLib/Refactor/Security/Composition/Util.leantheorem eval_mul' (x : R) (p q : CPolynomial R) :inArkLib/Refactor/Sumcheck/PolyUtils.leandef Messages.deriveTranscript {ι : Type} {oSpec : OracleSpec ι}inArkLib/Refactor/FiatShamir.leandef compNth {m : Type → Type} [Monad m] {S : Type}inArkLib/Refactor/Verifier.leantheorem oracleAwareRbrKnowledgeSoundness_implies_oracleAwareRbrSoundnessinArkLib/Refactor/Security/StateFunction.leantheorem rbrSoundness_replicate_zeroinArkLib/Refactor/Security/Composition/Soundness.leandef head {α : Type*} {A : α → Type*} {a : α} {as : List α}inArkLib/Refactor/HVector.leandef split (i : ChallengeIndex (pSpec₁ ++ pSpec₂)) :inArkLib/Refactor/ProtocolSpec.leandef ofSubSpec {ι₁ ι₂ : Type} {spec₁ : OracleSpec ι₁} {superSpec : OracleSpec ι₂}inArkLib/Refactor/OracleVerifier.leandef oracleSpecOfMessages : (pSpec : ProtocolSpec) → OracleSpec (MessageOracleIdx pSpec)inArkLib/Refactor/OracleVerifier.leantheorem partialEvalFirst_eval (a : R) (p : CMvPolynomial (n + 1) R) (v : Fin n → R) :inArkLib/Refactor/Sumcheck/PartialEval.leantheorem challengeTypes_append (p₁ p₂ : ProtocolSpec) :inArkLib/Refactor/ProtocolSpec.leandef OutputIndependent {ι : Type} {oSpec : OracleSpec ι} {σ : Type}inArkLib/Refactor/Security/Composition/Util.leantheorem length_messageTypes (pSpec : ProtocolSpec) :inArkLib/Refactor/ProtocolSpec.leandef Transcript.toPartial {pSpec : ProtocolSpec}inArkLib/Refactor/Transcript.leantheorem rbrKnowledgeSoundness_implies_knowledgeSoundnessinArkLib/Refactor/Security/Composition/KnowledgeSoundness.leandef PartialTranscript.concat :inArkLib/Refactor/Transcript.lean
sorry Tracking
✅ **Removed:** 1 `sorry`(s)
theorem distanceLE_mvPolynomial_degreeLE {σ : Type} [Fintype σ] [DecidableEq σ] :inArkLib/OracleReduction/OracleInterface.lean(L371)
❌ **Added:** 21 `sorry`(s)
theorem liftContext_toVerifier_comminArkLib/Refactor/LiftContext/OracleReduction.lean(L83)theorem stateRestorationSoundness_implies_soundnessinArkLib/Refactor/Security/StateRestoration.lean(L380)theorem liftContext_runinArkLib/Refactor/LiftContext/Reduction.lean(L126)theorem liftContext_knowledgeSoundnessinArkLib/Refactor/LiftContext/Reduction.lean(L210)theorem stateRestorationKnowledgeSoundness_implies_knowledgeSoundnessinArkLib/Refactor/Security/StateRestoration.lean(L396)theorem liftContext_rbrKnowledgeSoundnessinArkLib/Refactor/LiftContext/OracleReduction.lean(L202)theorem liftContext_rbrSoundnessinArkLib/Refactor/LiftContext/OracleReduction.lean(L182)def liftContext :inArkLib/Refactor/LiftContext/Reduction.lean(L147)theorem liftContext_rbrKnowledgeSoundnessinArkLib/Refactor/LiftContext/Reduction.lean(L231)def OracleVerifier.liftContextinArkLib/Refactor/LiftContext/OracleReduction.lean(L49)def OracleVerifier.liftContextinArkLib/Refactor/LiftContext/OracleReduction.lean(L52)theorem liftContext_rbrSoundnessinArkLib/Refactor/LiftContext/Reduction.lean(L218)theorem liftContext_knowledgeSoundnessinArkLib/Refactor/LiftContext/OracleReduction.lean(L174)def srKnowledgeSoundnessGameinArkLib/Refactor/Security/StateRestoration.lean(L237)def srKnowledgeSoundnessGameinArkLib/Refactor/Security/StateRestoration.lean(L277)def srKnowledgeSoundnessGameinArkLib/Refactor/Security/StateRestoration.lean(L293)def srKnowledgeSoundnessGameinArkLib/Refactor/Security/StateRestoration.lean(L309)theorem liftContext_soundnessinArkLib/Refactor/LiftContext/OracleReduction.lean(L160)theorem liftContext_completenessinArkLib/Refactor/LiftContext/OracleReduction.lean(L129)theorem liftContext_completenessinArkLib/Refactor/LiftContext/Reduction.lean(L171)theorem liftContext_soundnessinArkLib/Refactor/LiftContext/Reduction.lean(L197)
🎨 **Style Guide Adherence**
The following code changes violate the ArkLib style guide. Since there are more than 20 violations, they are grouped by rule below.
Grouped Violations
-
Rule: "Acronyms: Treat as words (e.g.,
HtmlParsernotHTMLParser)."- Violation Count: ~45
- Representative Examples:
def FSIdxinArkLib/Refactor/FiatShamir.lean:41(should beFsIdx)def liftFSTailinArkLib/Refactor/FiatShamir.lean:69(should beliftFsTail)abbrev OStmtinArkLib/Refactor/Sumcheck/Defs.lean:60(should beOstmt)class IsRBRSoundinArkLib/Refactor/Security/StateFunction.lean:79(should beIsRbrSound)
-
Rule: "Every definition and major theorem should have a docstring."
- Violation Count: >100
- Representative Examples:
def HVector.nilinArkLib/Refactor/HVector.lean:39(lacks docstring)theorem Reduction.completeness_compinArkLib/Refactor/Security/Composition/Completeness.lean:118(lacks docstring)def roundVerifierStateinArkLib/Refactor/Sumcheck/General.lean:41(lacks docstring)structure Witness.LensinArkLib/Refactor/LiftContext/Lens.lean:26(lacks docstring)
-
Rule: "Variable Conventions: ... h, h₁, ... : Assumptions/Hypotheses" and "Functions and Terms:
lowerCamelCase"- Violation Count: >80
- Representative Examples:
hNeinArkLib/OracleReduction/OracleInterface.lean:372(usesCamelCasefor a hypothesis; should beh_neorh)hDeginArkLib/OracleReduction/OracleInterface.lean:375(usesCamelCasefor a hypothesis; should beh_degorh)hPresinArkLib/Refactor/Security/Composition/Completeness.lean:130(usesCamelCasefor a hypothesis; should beh_presorh)szinArkLib/OracleReduction/OracleInterface.lean:389(non-standard variable name for a theorem result)
-
Rule: "Symbol Naming Dictionary: ≤ | le"
- Violation Count: ~15
- Representative Examples:
theorem distanceLE_mvPolynomial_degreeLEinArkLib/OracleReduction/OracleInterface.lean:369(should useleinstead ofLE)structure CDegreeLEinArkLib/Refactor/Sumcheck/PolyUtils.lean:71(should useLeorle)
Specific Violations
-
Rule: "Functions and Terms:
lowerCamelCase"is_completeinArkLib/Refactor/Security/Defs.lean:126(Class field usessnake_case)is_perfect_completeinArkLib/Refactor/Security/Defs.lean:131(Class field usessnake_case)is_soundinArkLib/Refactor/Security/Defs.lean:159(Class field usessnake_case)is_knowledge_soundinArkLib/Refactor/Security/Defs.lean:192(Class field usessnake_case)is_rbr_soundinArkLib/Refactor/Security/StateFunction.lean:80(Class field usessnake_case)
-
Rule: "Hypotheses: Prefer placing hypotheses to the left of the colon... rather than using arrows."
ArkLib/Refactor/Security/StateRestoration.lean:186:OracleComp oSpec α) : ∀ (σ0 : σ) (ch : Challenges pSpec), ... := by(Should moveσ0andchto the left of the colon as(σ0 : σ) (ch : Challenges pSpec) : ...)ArkLib/Refactor/Sumcheck/Security.lean:612:∀ (k : Nat), rbrSoundness ... := by(Should movekto the left of the colon)
📄 **Per-File Summaries**
-
ArkLib.lean: This update expands the library's main entry point by importing a suite of new modules from the
ArkLib.Refactordirectory. These imports introduce refactored definitions and proofs for cryptographic components, including Fiat-Shamir transforms, Sumcheck protocols, and a general framework for security composition and soundness. -
ArkLib/OracleReduction/OracleInterface.lean: This change provides a formal proof for the theorem
distanceLE_mvPolynomial_degreeLE, which establishes a bound on the distance between multivariate polynomials with restricted degrees. The proof leverages the Schwartz-Zippel lemma and removes a previously existingsorryplaceholder. -
ArkLib/Refactor/FiatShamir.lean: This file introduces the definitions and infrastructure for the Fiat-Shamir transformation, which converts public-coin interactive reductions into non-interactive ones using a random oracle. It defines the FS oracle specification, logic for FS-compatible prover and verifier execution, and the final
Reduction.fiatShamirtransformation. The implementation is complete and contains nosorryplaceholders. -
ArkLib/Refactor/HVector.lean: This file introduces a heterogeneous vector type,
HVector, implemented as a nested product of types to ensure universe stability across type families. It provides standard list-like operations such asmap,append,splitAt, andget, along with custom notation and several structural theorems; nosorryplaceholders are used. -
ArkLib/Refactor/LiftContext.lean: This new file serves as a central entry point for the
LiftContextmodule, aggregating imports for its lens, reduction, and oracle reduction submodules. It contains no new definitions, theorems, orsorryplaceholders. -
ArkLib/Refactor/LiftContext/Lens.lean: This file introduces several new definitions for "lenses" (such as
Statement.Lens,Witness.Lens, andOracleContext.Lens) designed to transport statements, witnesses, and oracles between different protocol interface layers. It also establishes type classes to define and verify side-conditions for these lenses, including soundness, completeness, and knowledge soundness. Nosorryoradmitplaceholders are included in the changes. -
ArkLib/Refactor/LiftContext/OracleReduction.lean: This file introduces definitions and a framework for lifting oracle-based provers, verifiers, and reductions into larger contexts using lenses. It includes several theorem statements for the preservation of completeness and various forms of soundness under these lifts, though many definitions and nearly all proofs currently contain
sorryplaceholders. -
ArkLib/Refactor/LiftContext/Reduction.lean: This file introduces infrastructure for lifting cryptographic reductions, honest provers, and verifiers into different contexts using a "lens" mechanism. It provides definitions for lifted components and establishes a theorem surface for proving the preservation of properties such as completeness and soundness, though most major preservation proofs currently contain
sorryplaceholders. -
ArkLib/Refactor/OracleVerifier.lean: Introduces the
OracleVerifierstructure and supporting infrastructure for protocols requiring oracle access to prover messages and input statements via theOracleCompmonad. Key additions include definitions for message-based oracle specifications, sequential verifier composition, and a conversion utility to standardVerifiertypes. Nosorryoradmitplaceholders are present in the file. -
ArkLib/Refactor/ProtocolSpec.lean: This file introduces a new list-based
ProtocolSpecdefinition to replace the previous indexed version, simplifying protocol composition and oracle interface synthesis. It provides core definitions for prover and verifier rounds, extraction functions for message and challenge types, and several supporting theorems for indexing and replication without anysorryplaceholders. -
ArkLib/Refactor/Prover.lean: This file introduces the
ProverandHonestProvertypes, providing a recursive framework for modeling interactive cryptographic protocols based on aProtocolSpec. It includes definitions for running, composing, and splitting provers, supported by formal proofs (such asrun_comp_joinandrun_splitPrefix_join) that verify the consistency of these operations. Nosorryoradmitplaceholders are present in the implementation. -
ArkLib/Refactor/Reduction.lean: This file introduces the
ReductionandOracleReductionstructures, which pair provers and verifiers as primary units for interactive proof composition. It provides definitions for sequential and$n$ -fold composition of these reductions, along with a mechanism to convert oracle-based reductions into plain reductions. - ArkLib/Refactor/Security/Composition.lean: This file serves as a central entry point for security composition by re-exporting submodules related to completeness, soundness, and knowledge soundness. It introduces no new definitions or theorems directly, acting solely as a module aggregator for the composition framework.
-
ArkLib/Refactor/Security/Composition/Completeness.lean: This file establishes the formal foundation for completeness composition in protocol reductions, proving that completeness errors add linearly under reduction composition and
$n$ -fold iteration. It introduces several key theorems, includingReduction.completeness_compandReduction.completeness_compNth, and demonstrates that perfect completeness is preserved through these operations; nosorryplaceholders are used. -
ArkLib/Refactor/Security/Composition/KnowledgeSoundness.lean: This new file establishes the formal relationship between round-by-round (RBR) knowledge soundness and standard knowledge soundness within a cryptographic protocol framework. It introduces several key theorems, most notably proving that RBR knowledge soundness implies global knowledge soundness and providing a bounded error for the
$n$ -fold composition of protocols (knowledgeSoundness_compNth). Nosorryoradmitplaceholders are present in the proofs. -
ArkLib/Refactor/Security/Composition/Soundness.lean: This file establishes the mathematical foundation for the composition of Round-By-Round (RBR) soundness in cryptographic protocols, proving that RBR soundness implies standard protocol soundness with a summed error bound. It introduces new definitions and theorems for the sequential and
$n$ -fold composition of sound verifiers, demonstrating that soundness is preserved with additive error using state invariants and state functions. Nosorryoradmitplaceholders are introduced in the proofs. -
ArkLib/Refactor/Security/Composition/Util.lean: This file introduces utility definitions and lemmas for protocol composition, including error-map combinators for appended and replicated protocols and predicates for "oracle-free" verifiers. It establishes that oracle-freedom is preserved under sequential composition and replication, and provides a probabilistic union-bound lemma for existential statements. The file contains no
sorryoradmitplaceholders. -
ArkLib/Refactor/Security/Defs.lean: This file introduces new formal definitions for cryptographic security notions within a refactored IOP model, including challenge sampling infrastructure, completeness, and soundness. It establishes a framework for knowledge soundness using straight-line extractors and provides specialized definitions for proof systems, utilizing a unified probability formulation over challenge and oracle randomness. No
sorryoradmitplaceholders are included. -
ArkLib/Refactor/Security/StateFunction.lean: This new file introduces formal definitions and theorems for round-by-round (RBR) soundness and knowledge soundness in cryptographic protocols. It defines
StateFunctionandKnowledgeStateFunctionstructures, establishes probabilistic RBR security properties, and provides theorems bridging knowledge soundness to standard soundness in both basic and oracle-aware settings. -
ArkLib/Refactor/Security/StateRestoration.lean: This file introduces a refactored framework for state-restoration (SR) security, including infrastructure for challenge replay and formal definitions for SR soundness and knowledge soundness. It establishes a constructive bridge between SR notions and basic outside-sampling security definitions, although several core lemmas and implication theorems currently contain
sorryplaceholders. -
ArkLib/Refactor/Sumcheck/Completeness.lean: This file defines the "true" intermediate targets and round values for the Sumcheck protocol and provides a backend-agnostic proof of single-round perfect completeness. It introduces a
RoundPolyBackendstructure to specify honest prover behavior and proves several theorems relating partial sums to the verifier's acceptance criteria without using anysorryplaceholders. -
ArkLib/Refactor/Sumcheck/Defs.lean: This file introduces the core definitions and protocol specifications for a refactored sumcheck protocol, including structures for round states, oracle statements, and the evaluation-interpolation strategy for round polynomials. It consists entirely of new definitions and types without theorems or proofs, and contains no
sorryplaceholders. -
ArkLib/Refactor/Sumcheck/General.lean: This file implements the multi-round Sumcheck protocol by modularly composing
$n$ single-round steps using thecompNthconstruction. It introduces definitions for the multi-round protocol specification, verifiers (plain and oracle), and provers (standard and symbolic), while proving the existence of valid round polynomials to support the protocol's completeness. Nosorryoradmitplaceholders are present. -
ArkLib/Refactor/Sumcheck/PartialEval.lean: This file introduces new definitions and theorems for computable partial evaluation and domain summation of multivariate polynomials, providing the core symbolic operations required for the Sumcheck protocol. It includes semantic correctness lemmas relating these operations to standard polynomial evaluation and provides proofs for bounding the degree of the resulting "round polynomials." No
sorryoradmitplaceholders are present in the code. -
ArkLib/Refactor/Sumcheck/PolyUtils.lean: This new file provides utility definitions and theorems for computable polynomials, introducing degree-bounded subtypes (
CDegreeLE,CMvDegreeLE) andOracleInterfaceinstances to support the sumcheck protocol. It establishes bridge lemmas between the library’s polynomial types and Mathlib'sPolynomialand includes a verified, performance-optimized implementation of Lagrange interpolation. Nosorryoradmitplaceholders are present. -
ArkLib/Refactor/Sumcheck/Security.lean: This new file establishes the security properties of the general sumcheck protocol by introducing formal proofs for perfect completeness and round-by-round soundness. It derives the protocol's overall soundness error bound using a modular framework for composing interactive proofs and contains no
sorryoradmitplaceholders. -
ArkLib/Refactor/Sumcheck/SingleRound.lean: This new file introduces definitions for the core components of a single round of the sumcheck protocol, including the honest
prover, a plainverifier, and anoracleVerifier. It also provides asingleRoundReductionto formalize the interaction between the prover and verifier, and contains nosorryplaceholders. -
ArkLib/Refactor/Sumcheck/Test.lean: This file introduces a concrete test suite for the sumcheck protocol implementation over
ZMod 7, usingnative_decideto verify round-by-round computations and verifier acceptance. It also includes an end-to-end execution of the honest prover and verifier reduction via#eval!. -
ArkLib/Refactor/Transcript.lean: This file introduces definitions and theorems for protocol transcripts, messages, and challenges, providing a framework for managing full and partial interactive protocol data. It implements operations for splitting and joining these structures using structural recursion to ensure definitional equalities necessary for protocol composition proofs. The file includes numerous lemmas relating partial transcript projections to
HVectoroperations and contains nosorryoradmitplaceholders. -
ArkLib/Refactor/Verifier.lean: This file introduces the
Verifierdefinition, representing a "plain" verifier that processes full message transcripts directly without oracle access. It also provides foundational operations for modular protocol design, specifically sequential (comp) and iterated (compNth) composition of verifiers. -
ArkLibRefactor.lean: This file serves as a top-level aggregator for the refactored
ArkLiblibrary, importing core modules related to cryptographic protocols, the Sumcheck protocol, and security definitions. It provides a centralized entry point for components such as Fiat-Shamir transformations, transcript handling, and proofs for completeness and soundness. - blueprint/src/content.tex: This change integrates a new section into the blueprint documenting a list-based refactor for Interactive Oracle Proofs (IOPs). It specifically introduces draft content for self-contained security and composition proofs within the oracle reductions framework.
- blueprint/src/oracle_reductions/iop_refactor_security_composition.tex: This section formalizes the theoretical framework for a list-based IOP refactor, defining security notions such as round-by-round (RBR) soundness and knowledge soundness. It provides paper-style proofs for composing these local, per-round properties into global security bounds via union bounds and establishes the requirements for completeness under sequential composition in the presence of shared stateful oracles.
-
docs/design/iop-refactor.md: This design document proposes a major refactor of the Interactive Oracle Proof (IOP) framework, transitioning from
Fin-indexed protocol specifications to a more flexibleList-based model. The change aims to eliminate pervasive friction from index casting and rigid prover states, facilitating easier protocol composition and more robust proofs for round-by-round soundness. Key architectural updates include the use of heterogeneous vectors (HVector) for transcripts and a coinductiveInteractOutputProverto simplify state management. -
ArkLib/Refactor/Telescope/Security/Composition.lean: This new file establishes a composition layer for telescope-native security statements by re-exporting the path-sensitive soundness composition development. It currently serves as an umbrella module and introduces no new definitions, theorems, or
sorryplaceholders. - ArkLib/Refactor/Telescope/Security.lean: This new file establishes an umbrella module for the telescope security layer by aggregating definitions and composition theorems. It serves as a central entry point for the library's security substrate, focusing on semantic soundness and path-sensitive state functions.
- ArkLib/Refactor/Telescope.lean: This new file serves as a central umbrella module for the "Telescopic Protocol Specifications" refactor, aggregating core definitions, oracle-aware runtime interfaces, and security properties. It establishes a structured entry point for the telescope-native refactor substrate, including its application to the Sumcheck protocol.
-
ArkLib/Refactor/Telescope/Reduction.lean: This file introduces a framework for statement-indexed "Telescope Reductions," defining core structures like
HonestProverandOracleReductionto support challenger-driven protocol execution. It provides new definitions for the sequential composition and execution of these reductions, including utilities for logging oracle queries, and contains nosorryoradmitplaceholders. -
ArkLib/Refactor/Telescope/Security/Composition/Soundness.lean: This file introduces new theorems establishing the soundness of staged protocol compositions within the Telescope framework, primarily proving that structural soundness is closed under composition (
IsSound.comp) and providing associated error bounds. It culminates in a statement-indexed verifier soundness theorem for composed protocols and contains nosorryoradmitplaceholders. -
ArkLib/Refactor/Telescope/OracleVerifier.lean: This file introduces a statement-indexed oracle verifier infrastructure that allows verifiers to query both statement-specific input oracles and prior prover messages extracted from a protocol transcript. It provides new definitions to reify transcript data into a queryable oracle interface and includes a utility to convert these indexed verifiers into concrete verifiers. No
sorryplaceholders are present in the new definitions. -
ArkLib/Refactor/Telescope/Security/Defs.lean: This file introduces formal definitions and theorems for telescope protocol security, establishing the link between structural claim trees and verifier soundness. It provides the core theorem
IsSound.bound_terminalProbto bound the probability of reaching a good terminal state from a bad root claim, and bridges this to a statement-indexedsoundnessdefinition viasoundness_of_isSound. The implementation is complete and contains nosorryoradmitplaceholders. -
ArkLib/Refactor/Telescope/Sumcheck.lean: This file implements a refactored version of the sumcheck protocol using the
ProtocolCtxframework, threading the verifier's challenge prefix recursively through the protocol's state. It introduces new definitions for the telescope-native prover and verifier, along with comprehensive soundness theorems that establish probabilistic error bounds for the protocol. Nosorryoradmitplaceholders are used in the implementation or proofs. -
ArkLib/Refactor/Telescope/Basic.lean: This file introduces
ProtocolCtx, a W-type for telescopic protocol specifications where round types and challenges depend on values exchanged in earlier rounds. It provides core definitions for transcripts, provers, and verifiers, implements sequential composition and prefix splitting, and defines a recursiveClaimTreestructure for soundness analysis. The file introduces new definitions and theorems without anysorryoradmitplaceholders.
Last updated: 2026-03-10 01:41 UTC.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5ea17d64b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| name = "VCVio" | ||
| git = "https://github.com/Verified-zkEVM/VCV-io" | ||
| rev = "v4.28.0" | ||
| rev = "master" |
There was a problem hiding this comment.
Pin VCVio dependency to an immutable revision
Setting VCVio to rev = "master" makes builds drift over time, because the dependency reference is a moving branch rather than a fixed commit/tag; a fresh dependency resolution can pull a newer VCVio state than the one this change was validated against and break ArkLib without any change in this repository. Pinning lakefile.toml to a concrete revision preserves reproducibility while still allowing intentional upgrades.
Useful? React with 👍 / 👎.
Introduce a telescope-native `ProtocolCtx` surface so runtime wrappers, soundness composition, and sumcheck share one maximally dependent cutover path. Keep the telescope slice warning-clean and buildable as an isolated migration target. Made-with: Cursor
Summary
This PR introduces a complete rewrite of the IOP (Interactive Oracle Proof) model using list-based protocol specifications, replacing the
Fin n-indexed approach. The new model eliminates pervasive casting overhead and makes composition definitional.Motivation
The existing
ProtocolSpec n(indexed byFin n) creates significant friction:ProtocolSpec nandProtocolSpec mrequiresFin.castSucc/Fin.castAddeverywhereFin (n+1) → Typeare painful to define and composeFunction.Embedding.trans/Equiv.sumAssocare hard to work withsorrys due to indexing complexity, not mathematical difficultyArchitecture
The refactored model lives entirely under
ArkLib/Refactor/(27 new files, ~10,400 lines) and is strictly additive — no existing functionality is removed.Core modules:
ProtocolSpec—List (Direction × Type)with definitional appendHVector— heterogeneous vectors as the backbone for transcriptsTranscript— messages, challenges, and full transcripts overHVectorProver/Verifier/OracleVerifier— participants defined by structural recursionReduction— reductions between protocol specs with composition (comp,compNth)Security framework:
Security.Defs— completeness, soundness, knowledge soundness with outside challenge samplingSecurity.StateFunction/StateRestoration— state-function and state-restoration soundnessSecurity.Composition.{Util, Completeness, Soundness, KnowledgeSoundness}— modular composition theoremsSumcheck case study (validation target):
Sumcheck.Defs/SingleRound— single-round protocol definitionSumcheck.PolyUtils/PartialEval— polynomial utilities and partial evaluation lemmasSumcheck.Completeness— perfect completeness proofSumcheck.Security— round-by-round (RBR) soundness via compositionSumcheck.General— multi-round composition viacompNthSumcheck.Test— end-to-end computable test (#eval)Additional infrastructure:
FiatShamir— Fiat-Shamir transformation for list-based specsLiftContext/LiftContext.Lens— context lifting via lenses for embedding reductionsOther changes
OracleInterface.lean: ProveddistanceLE_mvPolynomial_degreeLE(Schwartz-Zippel bound for multivariate polynomials), filling asorryv4.28.0tomaster(required by new API surface)iop_refactor_security_composition.texchapterdocs/design/iop-refactor.mdwith full rationale and API referenceRemaining
sorrys (22 total)LiftContext/OracleReductionLiftContext/ReductionStateRestorationSumcheck/Test#evalAll core security composition theorems (completeness, soundness, knowledge soundness) and sumcheck security proofs are
sorry-free.Test plan
lake build ArkLibRefactorcompiles successfullylake build ArkLib(existing library) still compiles#eval Sumcheck.testinSumcheck/Test.leanruns the end-to-end sumcheck testsorrywarnings vialake buildoutputMade with Cursor