feat(Interaction): full interaction framework with concurrent semantics, open composition, and protocol frontends#433
feat(Interaction): full interaction framework with concurrent semantics, open composition, and protocol frontends#433
Conversation
Advance the CompPoly dependency from v4.28.0 (d7b9f98, 58 commits behind) to the latest upstream master tip. The bump is fully backward-compatible with no ArkLib code changes needed. Made-with: Cursor
Replace ~30 duplicated bivariate polynomial declarations (coeff, degrees, weighted degrees, eval, shift, root multiplicity, discriminant) with imports from CompPoly's ToMathlib bridge files. Fix downstream consumers for monomial name disambiguation and the now-unconditional weightedDegree_eq_natWeightedDegree. Net: 597 lines deleted, 47 lines changed across 4 files, zero new sorries. Made-with: Cursor
Bump VCVio from d37e586 to ebea2fa (12 commits). Remove the unused Q_ne_0 field from GuruswamiSudan.Conditions since dvd_property does not require it. Made-with: Cursor
…sors
- Restore `Q_ne_0` field in `GuruswamiSudan.Conditions`: non-zeroness
is integral to the decoder specification (Q=0 trivially satisfies the
algebraic conditions). `dvd_property` still doesn't require it.
- Fix `Conditions` docstring to accurately describe the structure.
- Fix `ne_zero_iff_coeffs_ne_zero` docstring ("all its coefficients" →
"its coefficient function").
- Add `[NoZeroDivisors F]` to `totalDegree_mul` statement — the theorem
is false over semirings with zero divisors.
Made-with: Cursor
Resolve isolated dot, long line, and unnecessary simpa warnings. Made-with: Cursor
New standalone interaction infrastructure built on W-type specs with role decorations, eliminating the old TwoParty/Multiparty inductives and ProtocolSpec/Direction wrappers. - Basic.lean: universe-polymorphic Spec, Transcript, Strategy, Decoration with map, BundledMonad, MonadDecoration, append/comp combinators - TwoParty.lean: Role, RoleDecoration (= Decoration on Spec), Strategy.withRoles, Counterpart, runWithRoles, per-node monad variants - Multiparty.lean: PartyDecoration + toRoles via Decoration.map, three-party knowledge-soundness examples with rfl proofs - Reduction.lean: Prover, Verifier, Reduction, execute parameterized by (pSpec : Spec) (roles : RoleDecoration pSpec) - PORTING.md: tracks core rebuild progress and next steps - Delete old ArkLib/Refactor/ folder (superseded) Made-with: Cursor
- Verifier: add StmtOut, rename decide→verify, m Bool→OptionT m StmtOut - OracleCounterpart: round-by-round challenger with accSpec growing at sender nodes - InteractiveOracleVerifier: unified challenger+verify (= OracleCounterpart at internal nodes, verify fn at .done) - OracleVerifier: batch structure with iov + transcript-dependent simulate + reify - OracleProver, OracleReduction: oracle-aware prover/reduction structures - Decoration.Refine: displayed decoration combinator (cf. displayed algebras, ornaments) - SenderDecoration: Refine specialized to RoleDecoration with role-dependent fiber - Universe polymorphism throughout TwoParty.lean - N-ary composition: replicate, chain, iterate for Spec/Decoration/Strategy/Transcript Made-with: Cursor
…tions Replace SenderDecoration (Decoration.Refine + PUnit junk at receiver nodes) with Role.Refine — a direct recursion on spec + roles that skips receiver nodes cleanly. Prove equivalence with Decoration.Refine for compatibility. Made-with: Cursor
- Add ArkLib/Interaction/Basic/{Spec,Decoration,Strategy,Append,Replicate,Chain,MonadDecoration,BundledMonad}
- Add ArkLib/Interaction/TwoParty/{Role,Decoration,Strategy,Swap,Compose,Refine,Examples}
- Remove monolithic Basic.lean and TwoParty.lean; update Multiparty, Reduction, Oracle imports
- Note Interaction/Basic/ in PORTING.md; add Interaction line to docs/wiki/repo-map.md
Made-with: Cursor
- Define Spec.Decoration.swap so roles.swap elaborates on Decoration (fun _ => Role) - Abbrev RoleDecoration.swap to Spec.Decoration.swap; use roles.swap in Swap/Compose theorems Made-with: Cursor
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
🤖 Gemini PR SummaryFormalizes a modular, dependently typed interaction framework in Lean 4, replacing the legacy Core Interaction & Concurrency
Oracle Security & Boundaries
Proof System Frontends & Computable Polynomials
Critical Technical Details:
|
| Metric | Count |
|---|---|
| 📝 Files Changed | 67 |
| ✅ Lines Added | 21489 |
| ❌ Lines Removed | 110 |
Lean Declarations
✏️ **Added:** 360 declaration(s)
abbrev IsCompleteinArkLib/Interaction/Boundary/Compatibility.leandef OracleCounterpart.mapOutput {ι : Type} {oSpec : OracleSpec.{0, 0} ι}inArkLib/Interaction/Oracle/Core.leantheorem plain_oracleSenderIndependent :inArkLib/Interaction/BCS/HybridDecoration.leandef queryRoundContinuationinArkLib/ProofSystem/Fri/Interaction/QueryRound.leantheorem perfectCompleteness_pullbackinArkLib/Interaction/Boundary/Security.leanabbrev afterMessageinArkLib/Interaction/FiatShamir/DuplexSponge.leandef appendRight :inArkLib/Interaction/Oracle/Core.leandef pullbackSimulateinArkLib/Interaction/Boundary/Oracle.leanabbrev afterChallengeinArkLib/Interaction/FiatShamir/DuplexSponge.leandef residualDegreeBound (i : ℕ) : ℕinArkLib/ProofSystem/Fri/Interaction/Core.leandef Strategy.ofChain {m : Type u → Type u} [Monad m]inArkLib/Interaction/Reduction.leantheorem simulateQ_cast_specinArkLib/Interaction/Oracle/Core.leantheorem simulateQ_castinArkLib/Interaction/Oracle/Core.leandef evalPointVal (i : ℕ) (idx : EvalIdx (ninArkLib/ProofSystem/Fri/Interaction/Core.leandef pullbackinArkLib/Interaction/Boundary/Reification.leantheorem Reduction.completeness_compinArkLib/Interaction/Security.leandef reifiedPerfectCompletenessinArkLib/Interaction/OracleReification.leandef Prover.fiatShamirinArkLib/Interaction/FiatShamir/Transform.leandef completenessinArkLib/Interaction/OracleSecurity.leanabbrev VerifierOutputinArkLib/Interaction/Oracle/Core.leanabbrev OracleStatement {ιₛ : Type v} (OStmt : ιₛ → Type w)inArkLib/Interaction/Oracle/Core.leandef toFSStatementinArkLib/Interaction/FiatShamir/DuplexSponge.leandef od : {n : Nat} → (c : Chain n) → OracleDecoration (toSpec c) (roles c)inArkLib/Interaction/Oracle/Continuation.leandef answerSplitLiftAppendQueryinArkLib/Interaction/OracleReification.leantheorem partialEvalFirst_eval (a : R) (p : CMvPolynomial (n + 1) R) (v : Fin n → R) :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leandef runinArkLib/Interaction/Oracle/Continuation.leanabbrev Prover (m : Type u → Type u)inArkLib/Interaction/Reduction.leantheorem foldNth_natDegree_le_of_leinArkLib/Data/CompPoly/Fold.leantheorem roundOracleReduction_execute_eq_statefulinArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leandef IndividualDegreeLE (deg : ℕ) (p : CMvPolynomial n R) : PropinArkLib/Data/CompPoly/Basic.leanabbrev InputStatement : TypeinArkLib/ProofSystem/Fri/Interaction/Protocol.leandef finalFoldRoles : RoleDecoration (finalFoldSpec (FinArkLib/ProofSystem/Fri/Interaction/Core.leandef finalFoldOD :inArkLib/ProofSystem/Fri/Interaction/Core.leandef outputRelationOfRelationinArkLib/Interaction/OracleReification.leanabbrev squeezeLeninArkLib/Interaction/FiatShamir/DuplexSponge.leandef OracleDecoration.QueryHandle :inArkLib/Interaction/Oracle/Core.leantheorem simulateQ_add_liftComp_leftinArkLib/Interaction/Boundary/Oracle.leanabbrev PolyStmt (R : Type) [BEq R] [CommSemiring R] [LawfulBEq R]inArkLib/ProofSystem/Sumcheck/Interaction/Defs.leandef fsContext (Context : StatementIn → Spec.{u})inArkLib/Interaction/FiatShamir/Transform.leandef inputRelationOfReifiedRelationinArkLib/Interaction/OracleReification.leantheorem pullbackSimulate_evalinArkLib/Interaction/Boundary/Oracle.leanabbrev foldRoundCodewordinArkLib/ProofSystem/Fri/Interaction/Core.leandef honestCodeword (i : ℕ) (p : HonestPoly (FinArkLib/ProofSystem/Fri/Interaction/Core.leanabbrev serializeinArkLib/Interaction/FiatShamir/DuplexSponge.leandef liftOutputinArkLib/Interaction/Oracle/Core.leantheorem honestFinalPolynomial_natDegree_leinArkLib/ProofSystem/Fri/Interaction/Core.leantheorem roundOracleReduction_honestExecutionEquivalentStatefulinArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leanabbrev FoldChallenges : TypeinArkLib/ProofSystem/Fri/Interaction/Core.leandef foldPhaseContinuation {ι : Type} {oSpec : OracleSpec ι}inArkLib/ProofSystem/Fri/Interaction/FoldPhase.leandef splitNth (n : ℕ) [NeZero n] (p : CPolynomial R) : Fin n → CPolynomial RinArkLib/Data/CompPoly/Fold.leandef Verifier.run {m : Type u → Type u} [Monad m]inArkLib/Interaction/Reduction.leandef currentRoundResidual {n prefixLen : Nat} (h : prefixLen < n)inArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leandef fsStatementOutinArkLib/Interaction/FiatShamir/Transform.leandef roles : {n : Nat} → (c : Chain n) → RoleDecoration (toSpec c)inArkLib/Interaction/Oracle/Continuation.leanabbrev PolyFamily (R : Type) [BEq R] [CommSemiring R] [LawfulBEq R]inArkLib/ProofSystem/Sumcheck/Interaction/Defs.leantheorem realizes_materializeOutinArkLib/Interaction/Boundary/Reification.leaninstance of interpreter lifting (cf. Xia et al., *Interaction Trees*): the innerinArkLib/Interaction/Boundary/Oracle.leanabbrev FinalStatement : TypeinArkLib/ProofSystem/Fri/Interaction/Core.leandef routeInnerOutputQueriesinArkLib/Interaction/Boundary/Oracle.leandef foldRoundRolesinArkLib/ProofSystem/Fri/Interaction/Core.leantheorem realizes_simOracle0inArkLib/Interaction/OracleSecurity.leanabbrev rolesinArkLib/Interaction/Reduction.leandef fsWitnessOutinArkLib/Interaction/FiatShamir/Transform.leandef chainCompinArkLib/Interaction/Oracle/Continuation.leantheorem simulateQ_mapinArkLib/Interaction/Boundary/Oracle.leantheorem sumAllButFirst_eval (D : Fin m → R) :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leandef liftAppendLeftQueries :inArkLib/Interaction/Oracle/Core.leantheorem isKnowledgeSound_implies_isSoundinArkLib/Interaction/Security.leandef randomChallenger (sample : (T : Type) → ProbComp T) :inArkLib/Interaction/Security.leandef OracleDecoration.oracleContextImplinArkLib/Interaction/Oracle/Core.leantheorem toUnivariate_natDegree_le {deg : ℕ}inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leandef PublicCoinVerifier.fiatShamirinArkLib/Interaction/FiatShamir/Transform.leantheorem toUnivariate_eval (p : CMvPolynomial 1 R) (x : R) :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leantheorem routeInnerOutputQueries_materializeinArkLib/Interaction/Boundary/Reification.leanabbrev InputImplinArkLib/Interaction/OracleSecurity.leandef evalSize (i : ℕ) : ℕinArkLib/ProofSystem/Fri/Interaction/Core.leantheorem toMonadDecoration_appendinArkLib/Interaction/Oracle/Execution.leantheorem partialEvalLast_eval (a : R) (p : CMvPolynomial (n + 1) R) (v : Fin n → R) :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leandef IsKnowledgeSound {m : Type u → Type u} [Monad m] [HasEvalSPMF m]inArkLib/Interaction/Security.leandef stepResidual (chal : R)inArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leandef Reduction.stateChainComp {m : Type u → Type u} [Monad m]inArkLib/Interaction/Reduction.leanabbrev ReifiedOutputRelationinArkLib/Interaction/OracleReification.leandef inputLanguageOfReifiedLanguageinArkLib/Interaction/OracleReification.leandef currentResidual {n prefixLen : Nat} (h : prefixLen ≤ n)inArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leantheorem answerSplitLiftAppendQueryAppend_simOracle0inArkLib/Interaction/Oracle/Execution.leantheorem runWithOracleCounterpart_mapCounterpartOutputinArkLib/Interaction/Oracle/Execution.leandef SimulatesConcreteinArkLib/Interaction/OracleReification.leanabbrev OutputLanguageinArkLib/Interaction/OracleSecurity.leandef mapExecuteWitnessinArkLib/Interaction/Oracle/Execution.leandef runConcreteinArkLib/Interaction/Oracle/Execution.leandef Prover.duplexSpongeFiatShamirinArkLib/Interaction/FiatShamir/DuplexSponge.leandef terminalGood {spec : Spec} {roles : RoleDecoration spec} {Claim : Type u}inArkLib/Interaction/Security.leandef pullbackCounterpartinArkLib/Interaction/Boundary/Oracle.leandef liftAppendRightQueries :inArkLib/Interaction/Oracle/Core.leantheorem routeInnerOutputQueries_evalinArkLib/Interaction/Boundary/Oracle.leandef CMvDegreeLEinArkLib/Data/CompPoly/Basic.leandef OracleReduction.stateChainComp {ι : Type} {oSpec : OracleSpec ι}inArkLib/Interaction/Oracle/StateChain.leanabbrev HonestProverOutput (StatementOut : Type u) (WitnessOut : Type v)inArkLib/Interaction/Reduction.leandef foldNth (n : ℕ) [NeZero n] (p : CPolynomial R) (α : R) :inArkLib/Data/CompPoly/Fold.leanabbrev foldPhaseOD :inArkLib/ProofSystem/Fri/Interaction/FoldPhase.leantheorem simulateQ_composeinArkLib/Interaction/Boundary/Oracle.leanabbrev OracleDecoration (spec : Spec) (roles : RoleDecoration spec)inArkLib/Interaction/Oracle/Core.leanabbrev PublicCoinVerifier (m : Type u → Type u)inArkLib/Interaction/Reduction.leandef reifiedKnowledgeSoundnessinArkLib/Interaction/OracleReification.leanabbrev afterMessage {X : Type u} {rest : X → Spec} {rRest : ∀ x, RoleDecoration (rest x)}inArkLib/Interaction/FiatShamir/Basic.leantheorem simulateQ_compConcreteinArkLib/Interaction/OracleReification.leantheorem simulateQ_liftAppendRightContext_eqinArkLib/Interaction/Oracle/Core.leantheorem simulateQ_liftAppendLeftContext_eqinArkLib/Interaction/Oracle/Core.leandef replay {m : Type u → Type u} [Monad m]inArkLib/Interaction/Reduction.leantheorem soundness_of_rbrSoundnessinArkLib/Interaction/Security.leandef finalFoldContinuation {SharedIn : Type} {ι : Type} {oSpec : OracleSpec ι}inArkLib/ProofSystem/Fri/Interaction/FinalFold.leandef pullbackVerifierinArkLib/Interaction/Boundary/Oracle.leandef comp {ι : Type} {oSpec : OracleSpec ι}inArkLib/Interaction/Oracle/Continuation.leandef Reduction.ofChain {m : Type u → Type u} [Monad m]inArkLib/Interaction/Reduction.leandef liftAppendRightContext :inArkLib/Interaction/Oracle/Core.leanabbrev ReifiedInputLanguageinArkLib/Interaction/OracleReification.leandef roundRoles : RoleDecoration (roundSpec R deg)inArkLib/ProofSystem/Sumcheck/Interaction/Defs.leandef executeConcreteinArkLib/Interaction/Oracle/Execution.leanabbrev RoundClaiminArkLib/ProofSystem/Sumcheck/Interaction/Defs.leandef routeInputQueriesOuterEvalinArkLib/Interaction/Boundary/Oracle.leandef fullSum {n : ℕ} {m_dom : ℕ} (D : Fin m_dom → R) (poly : PolyStmt R deg n) : RinArkLib/ProofSystem/Sumcheck/Interaction/Defs.leantheorem knowledgeSoundness_implies_soundnessinArkLib/Interaction/OracleSecurity.leantheorem simulateQ_collapseAppendOracleCompinArkLib/Interaction/Oracle/Execution.leandef partialEvalPrefix : {i k : ℕ} → (Fin i → R) → CMvPolynomial (i + k) R → CMvPolynomial k RinArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leantheorem pullbackSimulate_materializeinArkLib/Interaction/Boundary/Reification.leandef SpongeAnnotation (U : Type) :inArkLib/Interaction/FiatShamir/DuplexSponge.leandef OracleDecoration.toOracleSpec :inArkLib/Interaction/Oracle/Core.leantheorem completeness_pullbackinArkLib/Interaction/Boundary/Security.leanabbrev OutputImplinArkLib/Interaction/OracleSecurity.leanabbrev fullOD (n : Nat) :inArkLib/ProofSystem/Sumcheck/Interaction/General.leantheorem runWithOracleCounterpart_pullbackCounterpart_rawinArkLib/Interaction/Boundary/Oracle.leandef soundnessinArkLib/Interaction/OracleSecurity.leantheorem simulateQ_cast_depinArkLib/Interaction/Oracle/Core.leandef RealizesinArkLib/Interaction/Boundary/Reification.leandef accSpecAfter :inArkLib/Interaction/Oracle/Execution.leantheorem evalSize_pos (i : ℕ) : 0 < evalSize (ninArkLib/ProofSystem/Fri/Interaction/Core.leantheorem appendRight_range :inArkLib/Interaction/Oracle/Core.leantheorem splitLiftAppendOracleRange_eqinArkLib/Interaction/Oracle/Execution.leandef Terminal {spec : Spec} {roles : RoleDecoration spec} {Claim : Type u}inArkLib/Interaction/Security.leantheorem appendLeft_range :inArkLib/Interaction/Oracle/Core.leanabbrev EmptyOracleFamily : PEmpty → TypeinArkLib/ProofSystem/Fri/Interaction/Core.leandef Counterpart.ofChain {m : Type u → Type u} [Monad m]inArkLib/Interaction/Reduction.leanabbrev foldRoundChallengeinArkLib/ProofSystem/Fri/Interaction/Core.leanabbrev fullSpec (n : Nat) : SpecinArkLib/ProofSystem/Sumcheck/Interaction/Defs.leantheorem answerQuery_appendRight :inArkLib/Interaction/Oracle/Core.leandef roundPoly (D : Fin m → R) (k : ℕ) (p : CMvPolynomial (k + 1) R) : CPolynomial RinArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leanabbrev liftAppendOracleFamilyinArkLib/Interaction/Oracle/Execution.leantheorem sumcheckReduction_completenessinArkLib/ProofSystem/Sumcheck/Interaction/General.leandef OutputRealizesinArkLib/Interaction/OracleSecurity.leantheorem realizes_materializeIninArkLib/Interaction/Boundary/Reification.leantheorem Reduction.execute_compinArkLib/Interaction/Reduction.leandef PublicCoinVerifier.duplexSpongeFiatShamirinArkLib/Interaction/FiatShamir/DuplexSponge.leantheorem knowledgeSoundness_implies_soundnessinArkLib/Interaction/Security.leantheorem simulateQ_compose_lambdainArkLib/Interaction/Oracle/Core.leandef appendLeft :inArkLib/Interaction/Oracle/Core.leandef idinArkLib/Interaction/Oracle/Continuation.leanabbrev finalFoldChallengeinArkLib/ProofSystem/Fri/Interaction/Core.leandef collapseAppendOracleCompinArkLib/Interaction/Oracle/Execution.leantheorem answerQuery_appendLeft :inArkLib/Interaction/Oracle/Core.leandef Reduction.execute {m : Type u → Type u} [Monad m]inArkLib/Interaction/Reduction.leanabbrev OutputinArkLib/Interaction/OracleReification.leanabbrev foldPhaseContext : SpecinArkLib/ProofSystem/Fri/Interaction/FoldPhase.leanabbrev InputRelationinArkLib/Interaction/OracleSecurity.leandef rbrSoundnessinArkLib/Interaction/Security.leanabbrev roundChallenge (tr : Spec.Transcript (roundSpec R deg)) :inArkLib/ProofSystem/Sumcheck/Interaction/Defs.leantheorem roundProverStepStateful_fromResidualinArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leandef queryRoundSpec : SpecinArkLib/ProofSystem/Fri/Interaction/QueryRound.leandef routeInputQueriesinArkLib/Interaction/Boundary/Oracle.leandef deriveTranscript :inArkLib/Interaction/FiatShamir/Basic.leandef advanceinArkLib/ProofSystem/Sumcheck/Interaction/Defs.leandef Reduction.completenessinArkLib/Interaction/Security.leandef queryBatchConsistentinArkLib/ProofSystem/Fri/Interaction/QueryRound.leandef pullbackSharedinArkLib/Interaction/Oracle/Continuation.leandef liftAppendLeftQuery :inArkLib/Interaction/Oracle/Core.leandef partialEvalFirst (a : R) (p : CMvPolynomial (n + 1) R) : CMvPolynomial n RinArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leandef maxPathError {spec : Spec} {roles : RoleDecoration spec} {Claim : Type u}inArkLib/Interaction/Security.leantheorem roundProverStep_map_fstinArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leandef pullback {m : Type _ → Type _} [Monad m] [Functor m]inArkLib/Interaction/Boundary/Core.leandef roundFiberIdxinArkLib/ProofSystem/Fri/Interaction/Core.leandef challengePrefix (n : Nat) (tr : Spec.Transcript (fullSpec R deg n)) :inArkLib/ProofSystem/Sumcheck/Interaction/Defs.leandef initialCodewords (codeword : Codeword (FinArkLib/ProofSystem/Fri/Interaction/Core.leandef roundArity (i : Fin (k + 1)) : ℕinArkLib/ProofSystem/Fri/Interaction/Core.leandef queryRoundRoles : RoleDecoration (queryRoundSpec (ninArkLib/ProofSystem/Fri/Interaction/QueryRound.leandef runWithOracleCounterpartinArkLib/Interaction/Oracle/Execution.leandef honestFoldPoly {i : Fin k}inArkLib/ProofSystem/Fri/Interaction/Core.leantheorem simulateQ_add_liftComp_rightinArkLib/Interaction/Boundary/Oracle.leanabbrev EvalIdx (i : ℕ)inArkLib/ProofSystem/Fri/Interaction/Core.leandef sumOverLast (D : Fin m → R) (p : CMvPolynomial (n + 1) R) : CMvPolynomial n RinArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leandef toUnivariate (p : CMvPolynomial 1 R) : CPolynomial RinArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leanabbrev liftAppendOracleIdxinArkLib/Interaction/Oracle/Execution.leandef finalFoldSpec : SpecinArkLib/ProofSystem/Fri/Interaction/Core.leanabbrev FoldCodewordOracleFamilyinArkLib/ProofSystem/Fri/Interaction/Core.leanabbrev OracleProver {ι : Type} (oSpec : OracleSpec.{0, 0} ι)inArkLib/Interaction/Oracle/Core.leantheorem Reduction.perfectCompleteness_compinArkLib/Interaction/Security.leandef liftAppendRightQuery :inArkLib/Interaction/Oracle/Core.leanabbrev QueryResult : TypeinArkLib/ProofSystem/Fri/Interaction/QueryRound.leantheorem roundProverStep_map_residualWitnessinArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leandef statementResult {m_dom : Nat} (D : Fin m_dom → R) :inArkLib/ProofSystem/Sumcheck/Interaction/Defs.leantheorem roundProverStep_map_honestProverOutputWitnessinArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leantheorem sumOverLast_eval (D : Fin m → R) (p : CMvPolynomial (n + 1) R) (v : Fin n → R) :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leandef perfectCompletenessinArkLib/Interaction/OracleSecurity.leandef forgetExecuteWitnessinArkLib/Interaction/Oracle/Execution.leandef nextRoundIdxinArkLib/ProofSystem/Fri/Interaction/Core.leandef RoundCheckProp {m_dom : ℕ} (D : Fin m_dom → R) (target : RoundClaim R)inArkLib/ProofSystem/Sumcheck/Interaction/Defs.leanabbrev FSStatement (StatementIn : Type u) (Context : StatementIn → Spec.{u})inArkLib/Interaction/FiatShamir/Transform.leandef good {spec : Spec} {roles : RoleDecoration spec} {Claim : Type u}inArkLib/Interaction/Security.leanabbrev Proof (m : Type u → Type u)inArkLib/Interaction/Reduction.leandef toVerifierinArkLib/Interaction/Oracle/Core.leandef pullbackinArkLib/Interaction/Boundary/Oracle.leandef initialChallenges : FoldChallengePrefix (FinArkLib/ProofSystem/Fri/Interaction/Core.leantheorem rbrKnowledgeSoundness_implies_knowledgeSoundnessinArkLib/Interaction/Security.leandef spongeReplayOracleinArkLib/Interaction/FiatShamir/DuplexSponge.leantheorem IsSound.bound_terminalProbinArkLib/Interaction/Security.leantheorem foldNth_toPoly (n : ℕ) [NeZero n] (p : CPolynomial R) (α : R) :inArkLib/Data/CompPoly/Fold.leandef roundSpec : SpecinArkLib/ProofSystem/Sumcheck/Interaction/Defs.leandef accImplAfter :inArkLib/Interaction/Oracle/Execution.leantheorem honestFoldPoly_natDegree_le {i : Fin k}inArkLib/ProofSystem/Fri/Interaction/Core.leanabbrev InteractiveOracleVerifier {ι : Type} (oSpec : OracleSpec.{0, 0} ι)inArkLib/Interaction/Oracle/Core.leandef outputRelationOfReifiedRelationinArkLib/Interaction/OracleReification.leantheorem execute_pullbackinArkLib/Interaction/Boundary/Security.leantheorem simulateQ_mapinArkLib/Interaction/Oracle/Execution.leanabbrev Codeword (_s : Fin (k + 1) → ℕ+) (_n : ℕ) (i : ℕ) : TypeinArkLib/ProofSystem/Fri/Interaction/Core.leandef verifierOutputinArkLib/Interaction/Oracle/Core.leanabbrev fullRoles (n : Nat) : RoleDecoration (fullSpec R deg n)inArkLib/ProofSystem/Sumcheck/Interaction/Defs.leandef toVerifier {m : Type u → Type u} [Monad m]inArkLib/Interaction/Reduction.leanabbrev Verifier (m : Type u → Type u)inArkLib/Interaction/Reduction.leandef CDegreeLE (R : Type) [BEq R] [Semiring R] [LawfulBEq R] (d : ℕ)inArkLib/Data/CompPoly/Basic.leanabbrev roundPoly (tr : Spec.Transcript (roundSpec R deg)) :inArkLib/ProofSystem/Sumcheck/Interaction/Defs.leandef honestRoundPoly {m_dom : ℕ} (D : Fin m_dom → R)inArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leantheorem partialEvalFirst_individualDegreeLE {deg : ℕ} (a : R)inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leantheorem liftM_cast_query_add_rightinArkLib/Interaction/Oracle/Core.leandef routeInputQueriesInnerEvalinArkLib/Interaction/Boundary/Oracle.leandef Reduction.comp {m : Type u → Type u} [Monad m]inArkLib/Interaction/Reduction.leanabbrev ReplayOracle (spec : Spec.{u}) (roles : RoleDecoration spec) : Type uinArkLib/Interaction/FiatShamir/Basic.leandef remainingShift (i : ℕ) : ℕinArkLib/ProofSystem/Fri/Interaction/Core.leantheorem run_pullbackinArkLib/Interaction/Boundary/Security.leanabbrev InputOracleFamilyinArkLib/ProofSystem/Fri/Interaction/Core.leandef prefixShift (i : ℕ) : ℕinArkLib/ProofSystem/Fri/Interaction/Core.leantheorem simulateQ_cast_queryinArkLib/Interaction/Oracle/Core.leanabbrev InputLanguageinArkLib/Interaction/OracleSecurity.leantheorem rbrKnowledgeSoundness_implies_rbrSoundnessinArkLib/Interaction/Security.leantheorem routeInputQueries_evalinArkLib/Interaction/Boundary/Oracle.leandef HonestPubliclyEquivalentinArkLib/Interaction/Oracle/Execution.leantheorem splitNth_toPoly (n : ℕ) [NeZero n] (p : CPolynomial R) (i : Fin n) :inArkLib/Data/CompPoly/Fold.leandef outputAtEndinArkLib/Interaction/Oracle/Continuation.leandef Strategy.runWithReplayOracle {m : Type u → Type u} [Monad m] :inArkLib/Interaction/FiatShamir/Transform.leantheorem OracleReduction.HonestExecutionEquivalent.toPublicinArkLib/Interaction/Oracle/Execution.leanabbrev FoldChallengePrefix (i : ℕ) : TypeinArkLib/ProofSystem/Fri/Interaction/Core.leandef OracleSenderIndependent :inArkLib/Interaction/BCS/HybridDecoration.leanabbrev challenge {X : Type u} {rest : X → Spec} {rRest : ∀ x, RoleDecoration (rest x)}inArkLib/Interaction/FiatShamir/Basic.leandef CommitmentDecoration {ι : Type} (oSpec : OracleSpec.{0, 0} ι) :inArkLib/Interaction/BCS/HybridDecoration.leandef evalPoint (i : ℕ) (idx : EvalIdx (ninArkLib/ProofSystem/Fri/Interaction/Core.leanabbrev roundTranscript (n : Nat)inArkLib/ProofSystem/Sumcheck/Interaction/Defs.leandef answerQuery :inArkLib/Interaction/BCS/HybridDecoration.leanabbrev wit {StatementOut : Type u} {WitnessOut : Type v}inArkLib/Interaction/Reduction.leaninstance instOracleInterfaceCDegreeLE [Semiring R] :inArkLib/Data/CompPoly/Basic.leandef outputLanguageOfReifiedLanguageinArkLib/Interaction/OracleReification.leaninstance instOracleInterfaceCMvDegreeLE :inArkLib/Data/CompPoly/Basic.leanabbrev deserializeinArkLib/Interaction/FiatShamir/DuplexSponge.leandef reifiedSoundnessinArkLib/Interaction/OracleReification.leandef MessagesOnly :inArkLib/Interaction/FiatShamir/Basic.leandef PublicCoinReduction.fiatShamirinArkLib/Interaction/FiatShamir/Transform.leandef honestRoundPolyAtPrefix {m_dom : ℕ} (D : Fin m_dom → R)inArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leandef honestFinalPolynomialinArkLib/ProofSystem/Fri/Interaction/Core.leandef partialEvalLast (a : R) (p : CMvPolynomial (n + 1) R) : CMvPolynomial n RinArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leandef queryRoundOD :inArkLib/ProofSystem/Fri/Interaction/QueryRound.leandef roundProverStep (m : Type → Type) [Monad m]inArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leandef toSpec : {n : Nat} → Chain n → SpecinArkLib/Interaction/Oracle/Continuation.leantheorem reifiedKnowledgeSoundness_implies_reifiedSoundnessinArkLib/Interaction/OracleReification.leantheorem roundPoly_natDegree_le {deg : ℕ} (D : Fin m → R) {k : ℕ}inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leandef freezeSharedToPUnitinArkLib/Interaction/Oracle/Continuation.leandef roundOracleDecoration :inArkLib/ProofSystem/Sumcheck/Interaction/Oracle.leantheorem roundOracleReduction_honestPubliclyEquivalentStatefulinArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leandef PublicCoinReduction.duplexSpongeFiatShamirinArkLib/Interaction/FiatShamir/DuplexSponge.leantheorem liftAppendOracleFamily_append_eqinArkLib/Interaction/Oracle/Execution.leandef knowledgeSoundnessinArkLib/Interaction/OracleSecurity.leanabbrev OutputRelationinArkLib/Interaction/OracleSecurity.leantheorem evalSize_factorinArkLib/ProofSystem/Fri/Interaction/Core.leantheorem simulate_comp {ι : Type} {oSpec : OracleSpec ι}inArkLib/Interaction/Oracle/Continuation.leandef IsSound {m : Type u → Type u} [Monad m] [HasEvalSPMF m]inArkLib/Interaction/Security.leantheorem simulateQ_extinArkLib/Interaction/Boundary/Oracle.leantheorem soundness_compinArkLib/Interaction/Security.leantheorem roundContinuationOption_proverEq_statefulinArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leandef soundnessinArkLib/Interaction/Security.leandef ofOracleDecoration :inArkLib/Interaction/BCS/HybridDecoration.leantheorem IsKnowledgeSound.bound_terminalProbinArkLib/Interaction/Security.leandef plain :inArkLib/Interaction/BCS/HybridDecoration.leanabbrev FoldCodewordPrefixinArkLib/ProofSystem/Fri/Interaction/Core.leandef QueryHandle :inArkLib/Interaction/BCS/HybridDecoration.leandef OracleDecoration.answerQuery :inArkLib/Interaction/Oracle/Core.leantheorem roundOracleReduction_executePublic_eq_statefulinArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leandef queryBatchConsistentQinArkLib/ProofSystem/Fri/Interaction/QueryRound.leantheorem sumcheckReduction_soundnessinArkLib/ProofSystem/Sumcheck/Interaction/General.leanabbrev ReifiedInputRelationinArkLib/Interaction/OracleReification.leaninstance instOracleInterfaceCPolynomial [Nontrivial R] :inArkLib/Data/CompPoly/Basic.leandef answerSplitLiftAppendQueryAppendinArkLib/Interaction/Oracle/Execution.leaninstance instOracleInterfaceCMvPolynomial :inArkLib/Data/CompPoly/Basic.leandef outputinArkLib/Interaction/OracleReification.leaninstance instOracleInterfaceEmptyOracleFamily :inArkLib/ProofSystem/Fri/Interaction/Core.leandef foldRoundContinuation {SharedIn : Type} {ι : Type} {oSpec : OracleSpec ι}inArkLib/ProofSystem/Fri/Interaction/FoldRound.leandef runinArkLib/Interaction/Oracle/Execution.leanabbrev afterChallenge {X : Type u} {rest : X → Spec} {rRest : ∀ x, RoleDecoration (rest x)}inArkLib/Interaction/FiatShamir/Basic.leantheorem probAccept_pullback_leinArkLib/Interaction/Boundary/Security.leanabbrev IsSoundinArkLib/Interaction/Boundary/Compatibility.leanabbrev QueryBatch : TypeinArkLib/ProofSystem/Fri/Interaction/QueryRound.leandef splitLiftAppendOracleQueryinArkLib/Interaction/Oracle/Execution.leantheorem roundPoly_eval (D : Fin m → R) (k : ℕ) (p : CMvPolynomial (k + 1) R) (x : R) :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leandef foldRoundSpecinArkLib/ProofSystem/Fri/Interaction/Core.leandef answerSplitLiftAppendQueryinArkLib/Interaction/Oracle/Execution.leanabbrev HonestPoly (i : ℕ)inArkLib/ProofSystem/Fri/Interaction/Core.leantheorem partialEvalPrefix_individualDegreeLE {deg : ℕ} :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leandef buildSpongeReplayOracle :inArkLib/Interaction/FiatShamir/DuplexSponge.leandef rbrKnowledgeSoundnessinArkLib/Interaction/Security.leandef roundProverStepStateful (m : Type → Type) [Monad m]inArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leandef toOracleSpec :inArkLib/Interaction/BCS/HybridDecoration.leandef foldRoundODinArkLib/ProofSystem/Fri/Interaction/Core.leanabbrev stmt {StatementOut : Type u} {WitnessOut : Type v}inArkLib/Interaction/Reduction.leandef outputFamilyinArkLib/Interaction/Oracle/Continuation.leantheorem prefixShift_le_sub_roundinArkLib/ProofSystem/Fri/Interaction/Core.leandef toClaimTree {spec : Spec} {roles : RoleDecoration spec} {Claim : Type u}inArkLib/Interaction/Security.leantheorem prefixShift_succ (i : Fin (k + 1)) :inArkLib/ProofSystem/Fri/Interaction/Core.leandef Decoration.ofChain {S : Type u → Type v}inArkLib/Interaction/Reduction.leantheorem simulates_pullbackinArkLib/Interaction/Boundary/OracleSecurity.leantheorem runWithOracleCounterpart_mapOutputWithRolesinArkLib/Interaction/Oracle/Execution.leandef toMonadDecoration {ι : Type} (oSpec : OracleSpec.{0, 0} ι)inArkLib/Interaction/BCS/HybridReduction.leandef HonestExecutionEquivalentinArkLib/Interaction/Oracle/Execution.leanabbrev verifierMDinArkLib/Interaction/Oracle/Core.leanabbrev finalFoldPolynomialinArkLib/ProofSystem/Fri/Interaction/Core.leantheorem roundContinuation_publicEq_statefulinArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.leantheorem simulateQ_extinArkLib/Interaction/Oracle/Core.leandef toReduction {m : Type u → Type u} [Monad m]inArkLib/Interaction/Reduction.leandef RealizesinArkLib/Interaction/OracleSecurity.leandef knowledgeSoundnessinArkLib/Interaction/Security.leantheorem answerSplitLiftAppendQueryAppend_eqinArkLib/Interaction/Oracle/Execution.leandef evalAtIdx (p : CPolynomial F) {i : ℕ} (idx : EvalIdx (ninArkLib/ProofSystem/Fri/Interaction/Core.leandef roundCheck {m_dom : ℕ} (D : Fin m_dom → R) (target : RoundClaim R)inArkLib/ProofSystem/Sumcheck/Interaction/Defs.leanabbrev HybridDecoration (spec : Spec) (roles : RoleDecoration spec)inArkLib/Interaction/BCS/HybridDecoration.leandef executeinArkLib/Interaction/Oracle/Continuation.leandef follow {spec : Spec} {roles : RoleDecoration spec} {Claim : Type u}inArkLib/Interaction/Security.leandef reifiedCompletenessinArkLib/Interaction/OracleReification.leanabbrev ReifiedOutputLanguageinArkLib/Interaction/OracleReification.leandef totalShift : ℕinArkLib/ProofSystem/Fri/Interaction/Core.leanabbrev foldPhaseRoles :inArkLib/ProofSystem/Fri/Interaction/FoldPhase.leandef executePublicConcreteinArkLib/Interaction/Oracle/Execution.leantheorem runWithOracleCounterpart_pullbackCounterpartinArkLib/Interaction/Boundary/Oracle.leanabbrev OracleCounterpart {ι : Type} (oSpec : OracleSpec.{0, 0} ι)inArkLib/Interaction/Oracle/Core.leandef roundAnchorIdxinArkLib/ProofSystem/Fri/Interaction/Core.leandef liftAppendLeftContext :inArkLib/Interaction/Oracle/Core.leandef Reduction.perfectCompletenessinArkLib/Interaction/Security.leantheorem OracleReduction.mapExecuteWitness_eq_execute_mappedOutputinArkLib/Interaction/Oracle/Execution.leandef inputRelationOfRelationinArkLib/Interaction/OracleReification.leanabbrev InputWitness : TypeinArkLib/ProofSystem/Fri/Interaction/Protocol.leandef promoteStatementToSharedinArkLib/Interaction/Oracle/Continuation.leandef fsRoles (Context : StatementIn → Spec.{u})inArkLib/Interaction/FiatShamir/Transform.leantheorem OracleReduction.executePublic_eq_map_executeinArkLib/Interaction/Oracle/Execution.leandef sumAllButFirst (D : Fin m → R) : (k : ℕ) → CMvPolynomial (k + 1) R → CMvPolynomial 1 RinArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.leantheorem simulate_compFlat {ι : Type} {oSpec : OracleSpec ι}inArkLib/Interaction/Oracle/Continuation.leantheorem simulateQ_liftIdinArkLib/Interaction/Boundary/Oracle.leandef AcceptsinArkLib/Interaction/OracleSecurity.leandef toMonadDecoration {ι : Type} (oSpec : OracleSpec.{0, 0} ι)inArkLib/Interaction/Oracle/Core.lean
sorry Tracking
❌ **Added:** 19 `sorry`(s)
theorem sumAllButFirst_eval (D : Fin m → R) :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean(L125)theorem partialEvalPrefix_individualDegreeLE {deg : ℕ} :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean(L144)theorem partialEvalPrefix_individualDegreeLE {deg : ℕ} :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean(L149)theorem partialEvalPrefix_individualDegreeLE {deg : ℕ} :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean(L170)theorem partialEvalPrefix_individualDegreeLE {deg : ℕ} :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean(L171)theorem partialEvalPrefix_individualDegreeLE {deg : ℕ} :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean(L172)theorem partialEvalPrefix_individualDegreeLE {deg : ℕ} :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean(L173)theorem honestFinalPolynomial_natDegree_leinArkLib/ProofSystem/Fri/Interaction/Core.lean(L322)theorem partialEvalLast_eval (a : R) (p : CMvPolynomial (n + 1) R) (v : Fin n → R) :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean(L109)theorem partialEvalFirst_eval (a : R) (p : CMvPolynomial (n + 1) R) (v : Fin n → R) :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean(L102)theorem roundPoly_natDegree_le {deg : ℕ} (D : Fin m → R) {k : ℕ}inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean(L221)theorem toUnivariate_natDegree_le {deg : ℕ}inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean(L213)theorem toUnivariate_eval (p : CMvPolynomial 1 R) (x : R) :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean(L194)theorem sumOverLast_eval (D : Fin m → R) (p : CMvPolynomial (n + 1) R) (v : Fin n → R) :inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean(L116)theorem foldNth_toPoly (n : ℕ) [NeZero n] (p : CPolynomial R) (α : R) :inArkLib/Data/CompPoly/Fold.lean(L53)theorem splitNth_toPoly (n : ℕ) [NeZero n] (p : CPolynomial R) (i : Fin n) :inArkLib/Data/CompPoly/Fold.lean(L49)theorem foldNth_natDegree_le_of_leinArkLib/Data/CompPoly/Fold.lean(L59)theorem honestFoldPoly_natDegree_le {i : Fin k}inArkLib/ProofSystem/Fri/Interaction/Core.lean(L306)theorem partialEvalFirst_individualDegreeLE {deg : ℕ} (a : R)inArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean(L136)
🎨 **Style Guide Adherence**
This code review is based on the provided ArkLib style guide.
Documentation and Citation Violations
- Docstring Syntax (Backticks): The guide requires using backticks for Lean names (e.g.,
`List.map`). There are over 40 instances where Lean names are used in docstrings as plain text.ArkLib/Interaction/BCS/HybridDecoration.lean:18: "HybridDecoration — assigns an optional OracleInterface at each sender..." (Should be`HybridDecoration`and`OracleInterface`).ArkLib/Interaction/BCS/HybridDecoration.lean:21: "Defined as Role.Refine..." (Should be`Role.Refine`).ArkLib/Interaction/Boundary/Core.lean:25: "...FRIBinius witness reinterpretation, BatchedFRI batching boundary)."
- Docstring Quality: Docstrings must describe what a definition is or what a theorem states, and references to "TODO", design history, or reactive language are prohibited.
ArkLib/Interaction/BCS/HybridDecoration.lean:44: "...aligning with theOracleInterfacesTODO inProtocolSpec/Basic.leanand the functional BCS literature (eprint 2025/902)."
- Citation Standards: All cited papers must use citation keys (e.g.,
[ACFY24]) and include a## Referencessection in the file header.ArkLib/Interaction/BCS/HybridDecoration.lean:45: References "eprint 2025/902" directly and lacks a## Referencessection.
- Missing Docstrings: "Every definition and major theorem should have a docstring."
ArkLib/Data/CompPoly/Basic.lean:34:def CDegreeLElacks a docstring.ArkLib/Data/CompPoly/Basic.lean:39:def CMvDegreeLElacks a docstring.ArkLib/Data/CompPoly/Fold.lean:47:theorem splitNth_toPolylacks a docstring.ArkLib/Data/CompPoly/Fold.lean:51:theorem foldNth_toPolylacks a docstring.ArkLib/Data/CompPoly/Fold.lean:55:theorem foldNth_natDegree_le_of_lelacks a docstring.
Syntax and Formatting Violations
- Line Length: "Keep lines under 100 characters." There are over 30 violations of this rule.
ArkLib/Interaction/BCS/HybridDecoration.lean:159: Length 104.ArkLib/Interaction/Boundary/Oracle.lean:108: Length 104.ArkLib/Interaction/Boundary/Oracle.lean:405: Length 110.
- Indentation: "Use 2 spaces for indentation." There are over 100 violations where 3, 4, 5, or 6 spaces are used instead of consistent 2-space increments.
ArkLib/Data/CompPoly/Basic.lean:50:Query := Fin n → R(3 spaces).ArkLib/Data/CompPoly/Basic.lean:52:spec := (Fin n → R) →ₒ R(5 spaces).ArkLib/Interaction/Boundary/Oracle.lean:66:simp(6 spaces).
- Function Notation: "Prefer
fun x ↦ ...overλ x, ...." While the diff avoidsλ, it usesfun x =>exclusively. The guide specifically requests the↦symbol for function terms. (Pervasive across all new files).ArkLib/Data/CompPoly/Basic.lean:53:impl := fun points => do ...(Should use↦).ArkLib/Interaction/BCS/HybridDecoration.lean:61:abbrev HybridDecoration ... := Interaction.Role.Refine (fun X => ...)
- File Headers (Copyright Year): "Use standard file headers including copyright... (c) 2024".
ArkLib/Interaction/BCS/HybridDecoration.lean:2:Copyright (c) 2026(Incorrect year).ArkLib/Interaction/BCS/HybridReduction.lean:2:Copyright (c) 2026(Incorrect year).
Naming Convention Violations
- Theorem Naming Logic: "Hypotheses: Use
_of_to separate hypotheses, listed in the order they appear."ArkLib/Interaction/BCS/HybridDecoration.lean:163:plain_oracleSenderIndependent(Should beoracleSenderIndependent_plainororacleSenderIndependent_of_plainto indicate that the property follows from being 'plain').
📄 **Per-File Summaries**
-
AGENTS.md: This update refines the project's guardrails by introducing stylistic preferences for readable notation, term-style definitions, and the use of existing library combinators over bespoke helpers. It also clarifies global configuration settings for
autoImplicitand establishes stricter quality and maintenance standards for docstrings and wiki documentation. -
ArkLib.lean: This update expands the
ArkLiblibrary by importing several new modules related to interactive proof systems, oracle interactions, and Fiat-Shamir transformations. Specifically, it integrates new components for composition polynomials and the interactive protocols for FRI and Sumcheck. -
ArkLib/Data/CompPoly/Basic.lean: This file introduces definitions for degree-bounded univariate and multivariate computable polynomials, including a predicate for individual variable degrees. It also provides several
OracleInterfaceinstances to enable evaluation queries on these polynomial types within the library's oracle framework. -
ArkLib/Data/CompPoly/Fold.lean: This new file introduces native computable
splitNthandfoldNthoperations forCPolynomialto support FRI protocols without routing through Mathlib polynomials. It includes theorems relating these definitions to standard polynomial operations and degree bounds, thoughsplitNth_toPoly,foldNth_toPoly, andfoldNth_natDegree_le_of_lecurrently containsorryplaceholders. -
ArkLib/Interaction/Boundary/Compatibility.lean: This file introduces the
Statement.IsSoundandContext.IsCompleteclasses to formalize semantic soundness and completeness predicates across interaction boundaries. It also provides definitions to flatten oracle-aware boundaries into concrete plain boundaries, allowing the base predicates to be applied to oracle statements and contexts without anysorryoradmitplaceholders. -
ArkLib/Interaction/Boundary/Core.lean: This file introduces the core framework for "interaction boundaries," providing definitions like
Statement,Witness, andContextto reinterpret protocol interfaces without altering their underlying transcript or round structure. It includespullbackfunctions that adapt verifiers, provers, and reductions to these new interfaces through input projection and output lifting. Nosorryoradmitplaceholders are introduced. -
ArkLib/Interaction/Boundary/Oracle.lean: This file introduces an oracle access layer for interaction boundaries, providing a framework for verifier-side oracle simulation. It defines the
OracleStatementAccessstructure and thepullbackCounterpartcombinator to translate queries between inner and outer oracle specifications. The implementation includes several new definitions and theorems verifying that rerouted simulations maintain behavioral equivalence with their original counterparts. -
ArkLib/Interaction/Boundary/OracleSecurity.lean: This file defines the infrastructure for transporting oracle-based security properties across interaction boundaries, focusing on verifier simulation and honest execution views. It introduces several new definitions and theorems, most notably
simulates_pullback, which proves that boundary pullbacks preserve the correspondence between concrete oracle materialization and simulated oracle behavior for both verifiers and reductions. Nosorryoradmitplaceholders are included. -
ArkLib/Interaction/Boundary/Reification.lean: This file introduces the reification layer for interaction-native oracle boundaries, defining
OracleStatementReificationfor concrete data mapping and aRealizespredicate to ensure coherence between materialization and simulation views. It provides bundled structures for oracle statements and contexts along with several theorems relating simulation to materialization. These components are used to implement apullbackoperation that lifts oracle reductions across context boundaries. -
ArkLib/Interaction/Boundary/Security.lean: This file establishes the operational and security properties of verifiers and reductions when "pulled back" across interaction boundaries. It introduces theorems for soundness and completeness transport—such as
Verifier.probAccept_pullback_leandReduction.completeness_pullback—to prove that security guarantees are preserved when lifting executions from inner to outer statement types. Nosorryoradmitplaceholders are used in the proofs. -
ArkLib/Interaction/FiatShamir/Basic.lean: This file introduces the foundational definitions for the Fiat-Shamir transform, defining
ReplayOracleas a deterministic counterpart andMessagesOnlyas the data type for non-interactive proofs. It includes thederiveTranscriptfunction to reconstruct interactive transcripts from messages-only proofs and contains nosorryplaceholders. -
ArkLib/Interaction/FiatShamir/DuplexSponge.lean: This file introduces a concrete duplex sponge instantiation of the Fiat-Shamir transform, defining the
SpongeAnnotationstructure for node-specific serialization and thebuildSpongeReplayOraclefunction to generate deterministic challenges. It provides high-level definitions, such asPublicCoinReduction.duplexSpongeFiatShamir, to convert interactive public-coin protocols into non-interactive ones without the use ofsorryoradmitplaceholders. -
ArkLib/Interaction/FiatShamir/Transform.lean: This file implements the Fiat-Shamir transform for public-coin interactive protocols by replacing random verifiers with deterministic replay oracles. It introduces definitions for transforming interactive provers, verifiers, and reductions into their non-interactive counterparts, allowing for the generation and verification of "messages-only" proofs. No
sorryoradmitplaceholders are included. -
ArkLib/Interaction/Oracle/Continuation.lean: This file introduces new definitions and theorems for the sequential and multi-round composition of oracle reductions in interactive protocols. It defines an inductive
Chaintype to represent intrinsic round structures and acompoperator for binary composition, supported by theorems that establish the equivalence of composed simulators. The implementation contains nosorryoradmitplaceholders. -
ArkLib/Interaction/Oracle/Core.lean: This file establishes the core framework for oracle-based interactions by bridging the generic
Interaction.Speclayer with VCVio's oracle computation model. It introducesOracleDecorationfor path-dependent oracle access and provides the foundational definitions and theorems forOracleProver,OracleVerifier, andOracleReduction. Nosorryoradmitplaceholders are present in the implementation. -
ArkLib/Interaction/Oracle/Execution.lean: This file introduces the operational framework for executing oracle-based interactions, providing the infrastructure to compose reductions via transcript appending and manage accumulated oracle states. It defines the core
runWithOracleCounterpartexecution engine and high-level APIs for running concrete reductions and verifiers, supported by theorems for distributing monad decorations over specification compositions. Additionally, the file establishes formal notions of honest public and execution equivalence for relating different oracle reductions; nosorryoradmitplaceholders are used. -
ArkLib/Interaction/Oracle/StateChain.lean: This file introduces infrastructure for composing oracle interactions into state chains, providing a mechanism to thread prover/verifier state and accumulated oracle specifications across multiple protocol stages. It defines
stateChainVerifierandOracleReduction.stateChainCompto construct complex multi-stage oracle reductions from simpler individual steps. Nosorryoradmitplaceholders are present in the implementation. -
ArkLib/Interaction/OracleReification.lean: This file establishes a bridge between abstract oracle behaviors and concrete oracle statements, introducing the
Reificationstructure and derived security definitions such asreifiedSoundnessandreifiedCompleteness. It includes several new definitions and theorems, notably proving that reified knowledge soundness implies reified soundness and providing query-level simulation results for oracle composition. The proofs are complete and contain nosorryoradmitplaceholders. - ArkLib/Interaction/OracleSecurity.lean: This file introduces a "behavior-first" framework for defining the security of oracle-based interaction protocols, shifting focus from concrete oracle implementations to transcript-indexed oracle behaviors. It provides formal definitions for relative completeness, soundness, and knowledge soundness for oracle reductions and verifiers, and includes a theorem proving that knowledge soundness implies standard soundness.
-
ArkLib/Interaction/Reduction.lean: This file introduces a new framework for interactive protocols by defining
Prover,Verifier, andReductiontypes based on W-type interaction trees (Spec). It provides support for public-coin protocols, sequential composition of reductions, and execution over stateful or stateless chains, including a theorem characterizing the output of composed reductions. Nosorryoradmitplaceholders are used. -
ArkLib/Interaction/Security.lean: This file introduces foundational definitions and composition theorems for the completeness, soundness, and knowledge soundness of interactive reductions. It features a round-by-round analysis framework based on "claim trees" to derive global security bounds from local round properties, with all proofs provided and no
sorryplaceholders. -
ArkLib/ProofSystem/Fri/Interaction/Core.lean: This new file establishes the core executable definitions and interaction specifications for an interaction-native implementation of the FRI protocol. It introduces structural definitions for domain indexing, protocol round specifications (using the
Interactionframework), and honest prover logic, while includingsorryplaceholders for two theorems regarding polynomial degree bounds after folding. -
ArkLib/ProofSystem/Fri/Interaction/FinalFold.lean: This file introduces the
finalFoldContinuationdefinition, which implements the terminal fold round of the FRI protocol within an interactive oracle reduction framework. It defines the prover and verifier logic for sampling a final challenge and computing the final degree-bounded polynomial and its associated statement. -
ArkLib/ProofSystem/Fri/Interaction/FoldPhase.lean: This file introduces the definitions and logic necessary to chain
$k$ non-final FRI folding rounds into a single interaction continuation. It defines the protocol's state transitions, transcript reconstruction, and the corefoldPhaseContinuationusing a modular oracle-reduction framework, without the use of anysorryplaceholders. -
ArkLib/ProofSystem/Fri/Interaction/FoldRound.lean: This file introduces the
foldRoundContinuationdefinition to model a single non-final FRI folding round as a modular oracle reduction. It implements the logic for the honest prover's polynomial folding, the verifier's challenge sampling, and oracle simulation for the resulting folded codewords without anysorryplaceholders. - ArkLib/ProofSystem/Fri/Interaction/General.lean: This new file serves as an umbrella module for the interaction-native FRI (Fast Reed-Solomon Interactive Oracle Proof of Proximity) protocol development. It provides documentation for the protocol's architectural components, such as folding rounds and query phases, while currently acting as an organizational entry point with no new theorems or definitions.
-
ArkLib/ProofSystem/Fri/Interaction/Protocol.lean: This file defines the full interaction-native FRI (Fast Reed-Solomon Interactive Oracle Proof of Proximity) protocol by composing the folding and query phases using
OracleReduction.comp. It introduces new definitions for the terminal phase and the complete protocol reduction logic, and it contains nosorryplaceholders. -
ArkLib/ProofSystem/Fri/Interaction/QueryRound.lean: This new file formalizes the FRI query phase by introducing definitions and logic for sampling query batches and performing consistency checks across FRI rounds. It provides both direct and oracle-based functions to verify that sampled base-domain indices remain consistent with folded codewords and the terminal polynomial. No
sorryoradmitplaceholders are used in the implementation. -
ArkLib/ProofSystem/Sumcheck/Interaction/CompPoly.lean: This file introduces computable, cast-free operations for
CMvPolynomialandCPolynomialtailored for the Sum-check protocol, including partial evaluation, domain summation, and a bridge to univariate polynomials. It establishes theResidualPolystructure for tracking prover state, though most correctness and degree-preservation proofs are currently marked withsorryplaceholders. -
ArkLib/ProofSystem/Sumcheck/Interaction/Defs.lean: This file introduces the core definitions for an interaction-native sum-check protocol, including interaction specifications (
roundSpec,fullSpec), state transition logic (advance), and per-round verification functions (roundCheck). It defines the algebraic structure for representing polynomials and sum-claims across multi-round interactions using theVCVioframework. Nosorryoradmitplaceholders are present. -
ArkLib/ProofSystem/Sumcheck/Interaction/General.lean: This new file implements the general
$n$ -round oracle-native sum-check protocol by recursively composing single-round interactions within theVCVioframework. It introduces definitions for both stateless and stateful prover strategies—sumcheckReductionandsumcheckReductionStateful—alongside placeholder completeness and soundness theorems. While the file contains nosorryoradmitplaceholders, the security proofs are currently trivial and intended for future implementation. -
ArkLib/ProofSystem/Sumcheck/Interaction/Oracle.lean: This file introduces new definitions for an oracle-native sum-check protocol, specifically providing
roundOracleDecorationandoracleVerifierStepto handle single-round verifier logic and polynomial oracle queries. These components support a continuation-based refactor where the prover's univariate messages are treated as queryable oracles. Nosorryoradmitplaceholders are included. -
ArkLib/ProofSystem/Sumcheck/Interaction/SingleRound.lean: This file formalizes a single round of the sum-check protocol as an oracle reduction, providing definitions for computing residual polynomials, univariate round polynomials, and honest prover steps. It introduces both stateless and stateful implementations of the round continuation and provides theorems proving their public and execution equivalence in honest settings. No
sorryoradmitplaceholders are included in the code. - CONTRIBUTING.md: This update expands the style guide to emphasize code readability through the use of standard Lean notation, existing library combinators, and term-style definitions over tactics. Additionally, it establishes stricter quality standards for docstrings, requiring they focus on mathematical descriptions while prohibiting historical commentary or references to renamed or removed definitions.
-
INTERACTION_BOUNDARIES.md: This document provides the design specification for the
ArkLib.Interaction.Boundaryframework, which enables protocol interface adaptation (statement, witness, and oracle reinterpretation) while preserving the underlying transcript and round structure. It establishes a three-layer architecture—Core, Access, and Reification—to formalize how verifier simulations and prover materializations are "pulled back" across boundaries, explicitly decoupling these interface mappings from sequential protocol composition. -
INTERACTION_BRACHA_VERIFICATION.md: This document identifies Bracha Reliable Broadcast (RBC) as a primary benchmark for the
Interactionlibrary, noting its suitability for testing the framework’s concurrency, multiparty, and liveness features. It maps the landscape of existing protocol formalizations, such as Bythos and Veil, to positionInteractionas an interaction-centric alternative that prioritizes Lean-native verification over external SMT solvers. -
INTERACTION_CONCURRENT_SPEC.md: This design reference outlines a concurrent extension for the
ArkLib.Interactionlibrary, proposing a minimal continuation-based kernel centered on binary structural parallelism. It establishes a frontier-residual operational semantics to support adversarial scheduling and provides a comprehensive roadmap for integrating diverse concurrency mental models, such as state machines and partial-order semantics. -
INTERACTION_PROTOCOL_ROADMAP.md: This new documentation file outlines a strategic roadmap for evolving the
Interactionmodule into a generalized semantic framework for modeling and verifying concurrent protocols. It details a six-phase development plan covering core concurrency foundations, choreography frontends, knowledge-based security, and causal models. The proposed architecture prioritizes first-class support for partial observability, scheduler control, and causal equivalence across diverse protocol families. -
PORTING.md: This documentation tracks the architectural overhaul of the library's core interaction and oracle layers, detailing the transition from a flat protocol model to a universe-polymorphic system based on
Interaction.Spec(W-type game trees). It provides a comprehensive roadmap of the rebuild, outlining completed phases for foundational interactions and oracle verifiers, current progress on security definitions, and planned migrations for downstream cryptographic protocols. - blueprint/src/coding_theory/defs.tex: This update refines the mapping between blueprint definitions and the Lean formalization by providing more precise, namespaced paths for interleaved codes and proximity measures. It also improves the formatting of references for generator matrices.
- blueprint/src/content.tex: This change introduces the "Interaction Framework" chapter to the project blueprint, establishing the formal structure for foundational concepts like protocol composition, the Fiat-Shamir transformation, and security definitions. It serves to organize the theoretical groundwork necessary for modeling interactive proofs and oracle-based protocols.
-
blueprint/src/interaction/boundary.tex: This file introduces the concept of protocol "Boundaries," providing a dependent-type-native framework for reinterpreting statement, witness, and oracle interfaces without altering transcript structures. It defines a layered architecture for query simulation and concrete data reification, establishing the necessary pullback operations and coherence predicates (such as
Realizes) to transport soundness and completeness properties across protocol layers. -
blueprint/src/interaction/composition.tex: This file documents the formalization of sequential composition and iteration mechanisms for interaction specifications and strategies. It introduces the
liftAppendcombinator to manage dependent types without explicit casts and defines various iteration patterns, including state-indexed chains and continuation-based telescopes. -
blueprint/src/interaction/fiat_shamir.tex: This document specifies a Fiat-Shamir transform for dependent interaction trees, where the protocol's future shape can depend on earlier verifier challenges. It introduces a
PublicCoinCounterpartstructure to enable verifier-side transcript replay and defines a method for reconstructing full transcripts from sender-only message sequences using a deterministic replay oracle. -
blueprint/src/interaction/foundations.tex: This file introduces the foundational theory for modeling interactive protocols as dependently-typed trees (
Spec), allowing for protocols where message spaces and round counts depend on previous moves. It defines core abstractions includingTranscript, metadataDecoration, and monadicStrategy, prioritizing structural recursion over index-based arithmetic to simplify protocol composition and reasoning. -
blueprint/src/interaction/oracle.tex: This file adds a new section to the blueprint defining the formal framework for path-dependent oracle access in interactive oracle proofs. It introduces definitions for
OracleDecorationandQueryHandleto model queryable transcript messages and provides a bridge to the genericCounterpart.withMonadsframework to enable compositionalOracleReductionandOracleVerifierstructures. -
blueprint/src/interaction/security.tex: This file defines formal security properties—including completeness, soundness, and knowledge soundness—within the
Spec + RoleDecorationinteraction framework. It introduces claim trees for round-by-round soundness analysis and specifies oracle-level security definitions that rely on the existence of concrete data to satisfy the verifier's simulation. -
blueprint/src/interaction/two_party.tex: This file adds the formal specification for two-party and multi-party interactions by decorating existing interaction trees with sender and receiver roles. It defines the duality between choosing moves (
$\Sigma$ -types) and responding to them ($\Pi$ -types) to formalize strategies, counterparts, and role-aware refinements for oracle-based verification. - blueprint/src/macros/common.tex: This update introduces a set of LaTeX macros to support the formal documentation of a Spec-based interaction framework built on W-types. The new commands cover core concepts such as strategies, roles, decorations, and oracles.
-
blueprint/src/oracle_reductions/defs.tex: This update reformats the Lean declaration tags in the blueprint to use individual
\lean{}commands for each term instead of comma-separated lists. This change likely improves the granularity of the mapping between the formal LaTeX definitions and their corresponding Lean 4 implementations. -
blueprint/src/polynomials/defs.tex: This update removes the explicit Lean implementation tags
UniPolyandMlPolyfrom the blueprint definitions for computable univariate and multilinear polynomials. This effectively decouples these high-level definitions from their specific Lean identifiers in the documentation. -
blueprint/src/proof_systems/binius.tex: The changes remove
\leancommand references that linked mathematical definitions and theorems for binary tower fields to specific Lean identifiers. This decouples the high-level documentation in the blueprint from the underlying formal implementation names. -
blueprint/src/proof_systems/simple_protocols.tex: The changes refine the mapping between the blueprint and the Lean implementation by splitting combined
\leantags into individual commands for theDoNothingreduction. Additionally, the reference toCheckClaim.oracleReduction_completenesswas removed, likely to reflect changes in the underlying formalization. -
blueprint/src/proof_systems/stir.tex: This update refines the LaTeX blueprint by splitting grouped Lean declaration links into individual
\leancommands. This change ensures each formal theorem and definition is explicitly and separately mapped to its corresponding mathematical lemma. -
blueprint/src/proof_systems/whir.tex: This documentation update refines the Lean tags in the blueprint by splitting multi-item
\leancommands into separate entries. These changes improve the mapping between the LaTeX definitions and their corresponding Lean declarations for the WHIR proof system. - blueprint/src/references.bib: This change expands the bibliography by adding several references related to dependent type theory (ornamental algebras and interactive programs) and modern cryptography. Key additions include works on SNARK protocols (Zinc, Jolt) and the formalization/standardization of the Fiat-Shamir transformation.
-
blueprint/src/vcv/defs.tex: This PR updates the Lean 4 cross-reference tags in the blueprint to accurately match the namespaces and naming conventions used in the formal library. These refinements ensure that definitions such as
OracleSpec,evalDist, and various simulation oracles are correctly linked to their corresponding Lean implementations. - docs/wiki/README.md: This update expands the documentation index by adding references to new design specifications and roadmaps concerning interaction boundaries, concurrency, protocol families, and formal verification benchmarks.
-
docs/wiki/repo-map.md: This update to the repository map documents the reorganization of the
ArkLib/Interaction/Concurrent/directory into specialized modules for structural concurrency, dynamic process semantics, and open-interface primitives. It clarifies the layout of recent additions, including open-boundary definitions and theOpenTheorycomposition interface. -
scripts/README.md: This update corrects the documentation for
validate.shto reflect that the script now enforces a zero-warning policy (excludingsorryplaceholders) for theArkLib/Interaction/directory. This expands the existing linting requirements previously only noted forArkLib/Data/. -
scripts/check-docs-integrity.py: The script now uses
git ls-filesto identify markdown files within the documentation and script directories. This change ensures that integrity checks are performed only on files tracked by Git, preventing the processing of untracked or local-only files. -
scripts/validate.sh: This update extends the validation script to enforce a zero-warning policy (excluding
sorryplaceholders) for theArkLib/Interaction/directory. This ensures that any new code in this section of the library must be free of warnings before passing the CI check. -
ArkLib/Interaction/BCS/HybridReduction.lean: This file introduces the
HybridOracleReductionstructure and thetoMonadDecorationfunction to support protocols where only select sender nodes carry oracle interfaces. These definitions generalize standard oracle reductions to facilitate the BCS transformation, and the file contains nosorryoradmitplaceholders. -
ArkLib/Interaction/BCS/HybridDecoration.lean: This file introduces
HybridDecoration, an infrastructure for the BCS transformation that allows prover messages to be either plain metadata or committed oracle messages. It defines several new structures and predicates for managing oracle queries and commitment metadata, including a theorem proving the well-formedness of the trivial plain decoration. Nosorryoradmitplaceholders are used.
Last updated: 2026-04-11 13:46 UTC.
Build Timing Report
Incremental Rebuild Signal
This compares a clean project build against an incremental rebuild in the same CI job; it is a lightweight variability signal, not a full cross-run benchmark. Slowest Current Clean-Build FilesShowing 20 slowest current targets, with comparison against the selected baseline when available.
|
Add "Authors: Quang Dao" to all Interaction files missing it. Rewrite Spec, Transcript, and ofList docstrings for clarity. Made-with: Cursor
Simplify Prover/Verifier/Reduction types: WitnessIn is plain, VerOutput deleted (verifier returns StatementOut), WitnessOut independent of StatementOut. Add Security.lean with completeness, soundness, knowledge soundness, ClaimTree, KnowledgeClaimTree, and round-by-round definitions. Update Oracle.lean, TwoParty Strategy/Compose, and Multiparty accordingly. Made-with: Cursor
autoImplicit = false is already set globally in lakefile.toml. Remove the duplicate set_option from all Interaction files and document this in AGENTS.md. Made-with: Cursor
…tors, overhaul docstrings Rename `Transcript.appendFamily` -> `liftAppend`, `Transcript.join` -> `append` (freeing `join` for n-ary flattening), and propagate across all files. Reorder Append.lean so `liftAppend` precedes `append`/`split` and `comp` precedes `compFlat`. Add new n-ary chain combinators in Chain.lean: `Transcript.chain` (telescope type), `Transcript.join`/`unjoin` (flatten/unflatten isomorphism with round-trip simp lemmas), `Transcript.liftJoin` (lift telescope-indexed families to chain transcripts). Rename `Spec.chainFamily` -> `Transcript.chainFamily`. Rewrite all docstrings in Append.lean, Chain.lean, and Compose.lean to be intrinsic and intuitive. Add docstring quality rule to CONTRIBUTING.md and AGENTS.md. Made-with: Cursor
…hain Move the continuation-style intrinsic chain (formerly `Spec.Unfolding` in `ChainIntrinsic.lean`) into `Basic/Chain.lean` as the canonical `Spec.Chain` API. Extract the old stage-indexed `Spec.chain` into a new `Basic/StateChain.lean` under the explicit `stateChain` prefix. Chain.lean now provides: - `Spec.Chain` (depth-indexed telescope: round spec + continuation) - `Chain.toSpec` (convert to concrete `Spec` via `Spec.append`) - `Chain.replicate`, `Chain.ofStateMachine` (derived constructors) - `Chain.splitTranscript` / `Chain.appendTranscript` (telescope ops) - `Chain.strategyComp` / `Chain.strategyCompUniform` (composition) StateChain.lean preserves the full legacy API under `stateChain*` names. Made-with: Cursor
…eChain Merge the intrinsic reduction layer (formerly `ReductionIntrinsic.lean`) into `Reduction.lean` as the default `Reduction.ofChain` surface. Rename all stage-threaded chain identifiers to `stateChain*` across TwoParty, Reduction, and Oracle modules. Reduction.lean gains: - `Decoration.ofChain` / `Chain.roles` (role decoration from Chain) - `Strategy.ofChain` / `Counterpart.ofChain` (recursive composition) - `Reduction.ofChain` (stateless chain-based reduction composition) Renames in TwoParty: - `RoleDecoration.chain` → `RoleDecoration.stateChain` - `Counterpart.chainComp*` → `Counterpart.stateChainComp*` - `Strategy.chainCompWithRoles*` → `Strategy.stateChainCompWithRoles*` Renames in Oracle: - `OracleReduction.chainComp` → `OracleReduction.stateChainComp` - `toMonadDecoration_chain` → `toMonadDecoration_stateChain` Made-with: Cursor
Express the sumcheck protocol using the Interaction.Spec framework: - CompPoly.lean: CDegreeLE / CMvDegreeLE types, computable partial evaluation, domain summation, roundPoly, OracleInterface instances - Defs.lean: shared algebraic core (RoundClaim, summation domain, round spec with role decoration) - SingleRound.lean: one-round spec, honest prover step, verifier step - General.lean: n-round stateChain composition, full spec/roles, reduction via stateChainCompUniform - Oracle.lean: oracle decoration, verifier step stub (sorry) Made-with: Cursor
Regenerate the umbrella import file to include new StateChain and Sumcheck/Interaction modules. Update PORTING.md architecture section and phase descriptions to reflect the Chain/StateChain naming, the merged intrinsic reduction layer, and initial Sumcheck progress. Made-with: Cursor
… and theorems Replace every `show ... from by simpa using` cast pattern with named recursive transport functions `Transcript.packAppend` / `unpackAppend`. Rewrite `Reduction.comp` to use non-flat `Strategy.compWithRoles` + `Counterpart.append`, add bridge lemma `Counterpart.append_eq_appendFlat_mapOutput`, and reprove `completeness_comp` / `soundness_comp` against the new structure. Update PORTING.md with Phase 4d progress. Made-with: Cursor
Return the next statement alongside the next witness so composed reductions can enforce prover/verifier statement agreement in completeness and reuse the same transport across the oracle and sumcheck interaction layers. Made-with: Cursor
AI-authored by Codex (GPT-5) on behalf of Quang Dao.
Add Phase 1 semantic layers over the process-centered concurrent core. - introduce finite prefixes and infinite runs - add observation extraction and transcript matching relations - add forward refinement over Process.System - add ticket-based fairness and semantic liveness predicates - extend concurrent examples to exercise the new APIs The new layer composes with the existing Process, Machine, and Tree frontends without changing their core semantics.
Strengthen the Phase 1 concurrent semantics with preservation results. - make run-prefix projections recursive on Run rather than routed through take - add observation-preserving transcript relations and run-level equality lemmas - add refinement corollaries for controllers, paths, events, tickets, and observations - add system-level safety transport under fairness transfer - extend examples to exercise ticket, observation, and safety preservation This makes the refinement layer useful for end-to-end reasoning rather than just local matched-step facts.
Add a symmetric refinement layer over process systems with packaged controller, path, ticket, trace, and observation equivalence notions. Extend the concurrent examples with bisimulation-based preservation results and wire the new modules into the public Interaction surface.
Extend the concurrent design reference with a literature-grounded comparison matrix and borrowing guide, add the standalone Interaction protocol roadmap, and link both from the wiki index.
Add a design note on Bracha reliable broadcast as an Interaction benchmark, compare Bythos and Veil, survey verified distributed-protocol frameworks, and state the kernel-only proof-trust policy for future Interaction verification layers.
Rewrite the main concurrent Interaction docstrings to lead with semantic role and intended use rather than representation details. Also tighten the comparison and policy layers so readers from cryptography or distributed systems can orient quickly without already thinking in PL semantics.
Generalize the concurrent execution stack over ProcessOver and keep closed-world Process APIs as explicit specializations. - move execution, run, fairness, liveness, policy, and refinement machinery onto the generic ProcessOver core - remove leftover phantom Party parameters from the generic refinement and bisimulation layers - restore closed-world convenience lemmas and examples with explicit specializations so the public API stays clear Verification: - lake build ArkLib.Interaction.Concurrent.Examples - lake build ArkLib - python3 ./scripts/check-docs-integrity.py
Introduce the first structural open-world layer for concurrent interaction. - add Concurrent.Interface with Interface := PFunctor, packet and query aliases, and packet-level interface morphisms - add PortBoundary with empty, swap, tensor, and variance-correct boundary morphisms - update the concurrent module map docs and regenerate ArkLib.lean Verification: - lake build ArkLib.Interaction.Concurrent.Interface - python3 ./scripts/check-docs-integrity.py
Add the first algebraic law layer for the open-composition direction. - reuse native PFunctor coproducts for interface sums - add packet/query coproduct structure and boundary tensor/swap laws - add lawful map/par/plug classes for OpenTheory This keeps the open-world work operations-first while making the structural API precise enough for the first concrete model.
Add interface and boundary equivalence structure for the open-composition layer, together with canonical tensor/unit/symmetry coherence data. Also add equivalence-guided remapping in OpenTheory via mapEquiv and its first transport laws. This keeps map/par/wire/plug as the small OpenTheory kernel while moving boundary reshaping below it into Interface and PortBoundary.
Extend the open-composition layer with mapEquiv transport for par, wire, and plug, and add the interface/boundary bridge lemmas needed to connect boundary equivalences back to chart-level composition. This keeps the OpenTheory kernel small while making boundary reassociation and symmetry usable in theorem statements.
Finish the binary oracle composition theorem surface by proving the public fused simulator bridge and its concrete reified specialization. This closes the remaining append-boundary transport gap across: - oracle append transport helpers - continuation-level fused simulation - reified concrete query simulation
Made-with: Cursor
…pen expressions Made-with: Cursor
Made-with: Cursor # Conflicts: # ArkLib/ProofSystem/Fri/RoundConsistency.lean
Move 50 files (Basic/*, TwoParty/*, Concurrent/*, Multiparty/*) from ArkLib/Interaction/ to VCVio/Interaction/. These are pure interaction theory modules with no reduction/oracle-specific dependencies. Kept files (Reduction, Security, Oracle/*, Boundary/*, FiatShamir/*) now import from VCVio.Interaction instead of ArkLib.Interaction. VCVio dependency updated to quang/interaction-migration branch. Made-with: Cursor
Implement the duplex sponge instantiation of the Fiat-Shamir transform for the interaction-native formalization. The basic FS transform is parametric in the ReplayOracle; this constructs a specific ReplayOracle from a duplex sponge with a concrete permutation. New definitions: - SpongeAnnotation: per-node serialization metadata (serialize at sender nodes, squeeze length + deserialize at receiver nodes) - buildSpongeReplayOracle: thread a CanonicalDuplexSponge through the Spec tree to produce a ReplayOracle - spongeReplayOracle / toFSStatement: statement initialization wrappers - Prover/PublicCoinVerifier/PublicCoinReduction.duplexSpongeFiatShamir: the full transform, composing with the existing basic FS machinery Made-with: Cursor
Made-with: Cursor
c5d277e to
5861161
Compare
Summary
This PR introduces the
Interactionframework: a complete, sorry-free formalization of interactive protocol semantics in Lean 4, replacing the old flatProtocolSpecmodel with a dependent-type-native design where later protocol rounds can depend on earlier moves.The framework is organized in clean, acyclic layers, from sequential two-party protocols up to concurrent open-system composition. It also includes interaction-native frontends for Sumcheck and FRI, plus supporting computable polynomial infrastructure.
Scale: 126 commits, 211 files changed, ~41K lines added across 66 Interaction modules, 12 proof-system modules, 2 CompPoly modules, 7 blueprint chapters, 5 design documents, and CI/tooling updates.
What's in this PR
1. Core sequential interaction (
Interaction/Basic/)Spec: W-type interaction trees with dependent branching (move types at later rounds depend on earlier moves)Transcript: complete plays through aSpecDecoration: per-node metadata with functorial mappingNode: realized node contexts, schemas, and telescope-style descriptionsSyntax/Shape/Interaction: generic local participant syntax, functorial refinements, and local execution lawsStrategy: one-player strategies with monadic effectsAppend/Replicate/Chain/StateChain: sequential composition, iteration, continuation-style telescopes, and stage-indexed state chainsBundledMonad/MonadDecoration: per-node monadic effectsOwnership: owner-based interaction model for buildingSyntaxOverobjects2. Two-party protocols (
Interaction/TwoParty/)Role: sender/receiver roles withAction/Dual/interactDecoration:RoleDecorationplusRoleMonadContext/RolePairedMonadContextStrategy:Strategy.withRoles,Counterpart,PublicCoinCounterpartwith transcript replay,runWithRolesexecution,runWithRolesAndMonadsfor per-node monadsCompose: append, replicate, stateChain composition for strategies and counterpartsRefine:Role.Refinefor role-aware data refinement (sender-specific data, no receiver padding)Swap: involutive role swap with composition lemmasExamples: concreterflproofs showing computed strategy types3. Multiparty local views (
Interaction/Multiparty/)Core:LocalViewinductive (active / observe / hidden / quotient) for partial observability,localSyntax, multipartyStrategyviaSyntaxOver.comapProfile: per-partyViewProfilefor heterogeneous observation across partiesBroadcast: public-transcript specialization (one acts, all observe)Directed: point-to-point sender/receiver edge decorationsExamples: three-party knowledge-soundness, adversarial delivery, adaptive corruption scenariosMultiparty.lean(root): N-party asSpec+PartyDecoration, with MPST-style projection to roles viatoRoles4. Concurrent semantics (
Interaction/Concurrent/)Structural layer:
Spec: structural concurrent syntax via binaryparFrontier/Trace: enabled events and scheduler linearizationsIndependence/Interleaving: true-concurrency diamond lemma and trace equivalenceDynamic process layer:
Process:StepOver/ProcessOver(context-parametric) and closed-worldStep/Processspecializations withNodeSemantics(controllers +LocalView)Machine: state-indexed transition system frontendTree: structural-tree frontend bridging toProcessControl/Profile/Current: scheduler ownership, per-party profiles, and current local viewsVerification layer:
Execution/Run: finite prefixes and infinite runs with metadata extractionObservation: transcript matching relations (by controller, event, ticket, observation)Refinement: forward simulation with behavior preservationBisimulation/Equivalence: symmetric refinement and packaged equivalence notionsPolicy: executable step policies with trace complianceFairness: weak/strong fairness via stable ticketsLiveness: temporal predicates, system-level safety/liveness under fairnessOpen composition layer:
Interface:Interface := PFunctor,Packet,Hom(chart),QueryHom(lens),Equiv,sumwith composition lawsOpenTheory: boundary-indexed algebra of open systems (map/par/wire/plug) withIsLawfultypeclasses (functoriality, naturality)OpenSyntax: tagless-final free lawful model (Expr), provingOpenTheorycoherenceExamples: in-flight delivery, looping processes, ticket bisimulation, observation simulation5. Reductions and security (
Interaction/Reduction.lean,Security.lean)Prover/Verifier/Reduction: interactive protocol participants overSpec+RoleDecorationPublicCoinVerifier: public-coin specializationReduction.comp/stateChainComp/ofChain: sequential and chain-based compositionClaimTree/KnowledgeClaimTree: per-round security decomposition6. Oracle layer (
Interaction/Oracle/)Core:OracleDecorationattaching path-dependent oracle interfaces to interaction nodes,OracleCounterpart,OracleProver,OracleReduction, query routingExecution:runWithOracleCounterpart, accumulated oracle specs, honest public/execution equivalenceContinuation: sequential and multi-round oracle reduction composition (Chain,comp)StateChain: oracle-aware state-chain verifier and reduction composition7. Oracle security and reification (
OracleSecurity.lean,OracleReification.lean)Reificationbridge between abstract behaviors and concrete oracle statements8. Boundaries (
Interaction/Boundary/)Core:Statement/Witness/Contextfor same-transcript interface adaptationOracle:OracleStatementAccess,pullbackCounterpartfor oracle boundary transportReification:OracleStatementReification,Realizescoherence predicateSecurity/OracleSecurity/Compatibility: transport of soundness, completeness, and simulation across boundaries9. Fiat-Shamir (
Interaction/FiatShamir/)Basic:ReplayOracle,MessagesOnly,deriveTranscriptTransform: full Fiat-Shamir transform for provers, verifiers, and reductions10. Proof system frontends
Sumcheck (
ProofSystem/Sumcheck/Interaction/):RoundClaim, domain summation, round specs with role decorationsstateChainComp(security proofs are scaffolding)CompPoly.lean)FRI (
ProofSystem/Fri/Interaction/):OracleReduction.compCompPoly (
Data/CompPoly/):CDegreeLE/CMvDegreeLEdegree-bounded types withOracleInterfaceinstancessplitNth/foldNthfor computable polynomial splitting/folding11. Documentation and infrastructure
Design documents:
PORTING.md: core rebuild progress trackerINTERACTION_BOUNDARIES.md: boundary framework specificationINTERACTION_CONCURRENT_SPEC.md: concurrent extension design referenceINTERACTION_PROTOCOL_ROADMAP.md: literature-grounded protocol roadmapINTERACTION_BRACHA_VERIFICATION.md: Bracha RBC as benchmark targetBlueprint: New "Interaction Framework" chapter with 7 sections (foundations, composition, two-party, Fiat-Shamir, oracle, security, boundary)
Tooling:
scripts/check-warning-log.py: new CI warning budget enforcementscripts/validate.sh: updated to run warning checks onInteraction/andData/subtrees (excluding sorry warnings)fe33688, VCVio to2fec633Wiki:
docs/wiki/repo-map.mdupdated with Interaction module mapSorry status
ArkLib/Interaction/(66 files): 0 sorries (the entire abstract framework is sorry-free)Data/CompPoly/Fold.lean: 3 sorries (bridge lemmas to MathlibtoPoly)ProofSystem/Fri/Interaction/Core.lean: 2 sorries (honest fold degree bounds)ProofSystem/Sumcheck/Interaction/CompPoly.lean: 14 sorries (evaluation, degree, and ring hom lemmas)ProofSystem/Fri/RoundConsistency.lean: 1 sorry (Lagrange completeness)General.leansecurity proofs usetrivialas explicit placeholdersTest plan
lake build ArkLibsucceeds./scripts/validate.shpasses (warning budget, import check, docs integrity)Interaction/orData/subtreesGeneral (1).lean,SingleRound (1).lean)Posted by Cursor assistant (model: claude-4.6-opus-high-thinking) on behalf of the user (Quang Dao) with approval.