Skip to content

feat(interaction): add core oracle protocol surface - #532

Draft
codygunton wants to merge 147 commits into
Verified-zkEVM:mainfrom
codygunton:cg/quang/core-rebuild-1-upstream
Draft

feat(interaction): add core oracle protocol surface#532
codygunton wants to merge 147 commits into
Verified-zkEVM:mainfrom
codygunton:cg/quang/core-rebuild-1-upstream

Conversation

@codygunton

Copy link
Copy Markdown
Collaborator

Summary

Extracts the core Interaction/oracle protocol surface from ArkLib PR #433 and rebases it onto current main as the first reviewable slice of a minimized Interaction stack.

These files are taken directly from PR #433 without modification:

  • ArkLib/Interaction/Oracle/Core.lean
  • ArkLib/Interaction/Oracle/Spec.lean
  • ArkLib/Interaction/Reduction.lean

It also includes the CompPoly oracle-interface pieces in ArkLib/Data/CompPoly/Basic.lean needed by the later Sumcheck integration.

This is the smallest useful first slice: the interaction-native reduction and oracle protocol surface plus the CompPoly oracle bridge, without execution/composition, Sumcheck, FRI, BCS, Fiat-Shamir, boundary, or security modules.

Dependency: CompPoly

ArkLib/Data/CompPoly/Basic.lean imports CompPoly.Multivariate.DegreeBound, which does not yet exist in Verified-zkEVM/CompPoly. That module is added in:

Until #241 lands, lakefile.toml/lake-manifest.json temporarily pin codygunton/CompPoly @ 36c32f00 (one commit ahead of upstream, carrying exactly that module). Once #241 merges, the pin will move back to Verified-zkEVM/CompPoly at the merged revision and the lakefile/manifest diff in this PR drops to zero.

New Completion Work In This PR

None. The substantive Lean content is from PR #433; this PR rebases, isolates, and validates the core slice.

Commit history

The branch carries the full core-rebuild history (Quang Dao's commits) followed by a single commit that pares the tree down to this slice, so authorship of the underlying work is preserved.

Validation

  • ./scripts/validate.sh passed on the branch (with the CompPoly pin above).

🤖 Generated with Claude Code

quangvdao and others added 30 commits March 28, 2026 08:10
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
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.
quangvdao and others added 11 commits April 13, 2026 18:21
- Remove accSpec parameter from Oracle.Verifier.toFun, hardcode to []ₒ
- Add liftCounterpartAcc helper to lift counterpart accumulated oracle
  specs in composition (no sorry)
- Rewrite completeness with OutputRealizes conjunct
- Rewrite knowledgeSoundness: adversarial prover outputs oStmtOut,
  extractor sees concrete oracle data
- Add oStmtOut parameter to Extractor.Straightline
- Remove duplicate Verifier.InputRelation/OutputRelation/Accepts
- Inline Accepts into soundness definition
- Update blueprint security section to match new definitions

Made-with: Cursor
…s hypothesis

- Add answerCommittedQueries: compute committed oracle responses from
  a full transcript (deterministic, pure)
- Add bcsPhase2: evaluate PublicQueryVerifier.decide with pre-computed
  query data
- Strengthen hLangOut in knowledgeSoundness_implies_soundness to include
  OutputRealizes conjunct (required for the proof to go through)
- Add detailed proof strategy comment for KS→soundness

Made-with: Cursor
- Add OpeningDeco structure to Oracle/BCS.lean: generic opening proof
  data for committed oracle nodes, parameterized by OpeningProof type
- Update PORTING.md with comprehensive Oracle.Spec layer status:
  file inventory, design decisions, updated TODO list
- Update KS→soundness open question to reflect new formulation

Made-with: Cursor
- Add N-ary chain composition (Oracle/Chain.lean) with Spec.Chain,
  Chain.Prover.comp, Chain.Verifier.comp, and Reduction.ofChain
- Prove Spec.runWithOracleCounterpart_mapOutputWithRoles in Execution.lean
- Prove knowledgeSoundness_implies_soundness in Security.lean (no sorry)
- Rename for maximal namespacing: Prover.compAux, Verifier.compAux,
  Verifier.retargetMonads, Counterpart.liftAcc

Made-with: Cursor
The acceptOStmt/acceptWitness approach is circular: it asks the caller
to supply concrete oracle realizations, which is the "knowledge" that
KS should extract. Revert to sorry with honest existential statement
and document the difficulty. Delete the legacy version in
OracleSecurity.lean which had the same flaw.

Made-with: Cursor
Introduce Counterpart.mapOracles as the structural combinator for
oracle-counterpart monad rewriting with a per-receiver reroute.

Refactor liftAcc and Verifier.retargetMonads as thin wrappers; adjust
Security proofs and statements to match.

Made-with: Cursor
Restore local proofs and explicit query routing after the main merge,
while keeping the remaining documented proof gaps isolated.

Made-with: Cursor
Removes every file introduced by the core-rebuild branch outside this
slice, so the branch's diff against main is exactly this cumulative
slice while preserving the full core-rebuild commit history.
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🤖 PR Summary

Mathematical Formalization

  • Defines Oracle.Spec to distinguish between public transcript messages and oracle-accessible sender messages.
  • Implements interactive protocols using W-type interaction trees to model provers, verifiers, and reductions with support for sequential and state-chain composition.
  • Adds OracleInterface instances for CDegreeLE and CMvDegreeLE to bridge polynomial arithmetic with oracle systems.
  • Introduces OracleDecoration and query routing for round-by-round oracle access within the VCVio computation model.

Structural Changes

  • Extracts the core protocol surface and reduction logic from PR WIP: rebuild Interaction and oracle protocol layers #433, isolating them from execution-specific modules like Sumcheck, FRI, and Fiat-Shamir.
  • Updates ArkLib.lean to incorporate the new Interaction and CompPoly modules into the library manifest.

Infrastructure

Proof Status

  • All introduced modules are fully formalized; no sorry or admit placeholders are used in this implementation.

Statistics

Metric Count
📝 Files Changed 7
Lines Added 2963
Lines Removed 1

Lean Declarations

✏️ **Added:** 148 declaration(s)
  • def Reduction.comp {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • def Counterpart.ofChain {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • theorem projectPublic_transcriptAppend : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev withMonads (spec : Spec) (roles : RoleDecoration spec) in ArkLib/Interaction/Reduction.lean
  • abbrev RoundOneQuery in ArkLib/Interaction/Oracle/Examples.lean
  • abbrev roundTwoOracleDecoration (tr₁ : Interaction.Spec.Transcript roundOneTranscriptSpec) : in ArkLib/Interaction/Oracle/Examples.lean
  • noncomputable def roundOneVerifierStep in ArkLib/Interaction/Oracle/Examples.lean
  • def PublicTranscript.liftAppend : in ArkLib/Interaction/Oracle/Spec.lean
  • theorem appendLeft_range : in ArkLib/Interaction/Oracle/Core.lean
  • def Reduction.toVerifier in ArkLib/Interaction/Oracle/Core.lean
  • theorem PublicTranscript.append_split : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev PublicCoinVerifier (m : Type u → Type u) in ArkLib/Interaction/Reduction.lean
  • def PublicTranscript.split : in ArkLib/Interaction/Oracle/Spec.lean
  • theorem simulateQ_liftAppendRightContext_eq in ArkLib/Interaction/Oracle/Core.lean
  • def OracleDeco.append : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev PublicCoinCounterpart (m : Type u → Type u) in ArkLib/Interaction/Reduction.lean
  • def QueryHandle.routeLeft : in ArkLib/Interaction/Oracle/Spec.lean
  • def liftAppendRightQuery : in ArkLib/Interaction/Oracle/Core.lean
  • def verifierOutput in ArkLib/Interaction/Oracle/Core.lean
  • theorem toOracleSpec_appendLeft : in ArkLib/Interaction/Oracle/Spec.lean
  • theorem runWithRoles_mapOutputWithRoles_mapOutput in ArkLib/Interaction/Reduction.lean
  • def appendRight : in ArkLib/Interaction/Oracle/Core.lean
  • theorem PublicTranscript.split_append : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev roundTwoTranscript (tr₁ : Interaction.Spec.Transcript roundOneTranscriptSpec) in ArkLib/Interaction/Oracle/Examples.lean
  • theorem simulateQ_liftAppendRightContext_eq_of_impl in ArkLib/Interaction/Oracle/Core.lean
  • def toVerifier in ArkLib/Interaction/Oracle/Core.lean
  • abbrev Challenge in ArkLib/Interaction/Oracle/Examples.lean
  • abbrev stmt {StatementOut : Type u} {WitnessOut : Type v} in ArkLib/Interaction/Reduction.lean
  • def CDegreeLE (R : Type) [BEq R] [Semiring R] [LawfulBEq R] (d : ℕ) in ArkLib/Data/CompPoly/Basic.lean
  • def QueryHandle.appendLeft : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev RoundTwoQuery in ArkLib/Interaction/Oracle/Examples.lean
  • abbrev verifierMD in ArkLib/Interaction/Oracle/Core.lean
  • abbrev Counterpart (m : Type u → Type u) in ArkLib/Interaction/Reduction.lean
  • def restrictLeft {r : Type → Type} [Monad r] : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev OracleStatement {ιₛ : Type v} (OStmt : ιₛ → Type w) in ArkLib/Interaction/Oracle/Core.lean
  • def PublicTranscript.append : in ArkLib/Interaction/Oracle/Spec.lean
  • instance instOracleInterfaceCMvDegreeLE : in ArkLib/Data/CompPoly/Basic.lean
  • def IndividualDegreeLE (deg : ℕ) (p : CMvPolynomial n R) : Prop in ArkLib/Data/CompPoly/Basic.lean
  • abbrev roundTwoQuery (tr₁ : Interaction.Spec.Transcript roundOneTranscriptSpec) in ArkLib/Interaction/Oracle/Examples.lean
  • def toCounterpart {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • abbrev roundOneTranscriptSpec : Interaction.Spec in ArkLib/Interaction/Oracle/Examples.lean
  • def liftOutput in ArkLib/Interaction/Oracle/Core.lean
  • theorem simulateQ_cast_query_id in ArkLib/Interaction/Oracle/Core.lean
  • def Decoration.ofChain {S : Type u → Type v} in ArkLib/Interaction/Reduction.lean
  • def restrictRight {r : Type → Type} [Monad r] : in ArkLib/Interaction/Oracle/Spec.lean
  • def compWithRolesFlat {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • def QueryHandle.appendRight : in ArkLib/Interaction/Oracle/Spec.lean
  • def Verifier.run {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • abbrev OracleCounterpart {ι : Type} (oSpec : OracleSpec.{0, 0} ι) in ArkLib/Interaction/Oracle/Core.lean
  • instance instOracleInterfaceCMvPolynomial : in ArkLib/Data/CompPoly/Basic.lean
  • abbrev roundOneQuery (oracle : RoundOneOracle) (challenge : Challenge) (query : RoundOneQuery) : in ArkLib/Interaction/Oracle/Examples.lean
  • def toMonadDecoration {ι : Type} (oSpec : OracleSpec.{0, 0} ι) in ArkLib/Interaction/Oracle/Spec.lean
  • theorem PublicTranscript.liftAppend_append : in ArkLib/Interaction/Oracle/Spec.lean
  • theorem simulateQ_cast in ArkLib/Interaction/Oracle/Core.lean
  • theorem answerQuery_secondRound (oracle1 : RoundOneOracle) (challenge1 : Challenge) in ArkLib/Interaction/Oracle/Examples.lean
  • abbrev Proof (m : Type u → Type u) in ArkLib/Interaction/Reduction.lean
  • def runWithRoles {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • theorem toOracleSpec_appendRight : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev HonestProverOutput (StatementOut : Type u) (WitnessOut : Type v) in ArkLib/Interaction/Reduction.lean
  • def OracleDecoration.QueryHandle : in ArkLib/Interaction/Oracle/Core.lean
  • abbrev secondRoundQuery (oracle1 : RoundOneOracle) (challenge1 : Challenge) in ArkLib/Interaction/Oracle/Examples.lean
  • theorem Reduction.execute_comp in ArkLib/Interaction/Reduction.lean
  • def QueryHandle.routeRight : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev roles in ArkLib/Interaction/Reduction.lean
  • abbrev roundTwoTranscriptSpec (_ : Interaction.Spec.Transcript roundOneTranscriptSpec) : Interaction.Spec in ArkLib/Interaction/Oracle/Examples.lean
  • abbrev packAppend (s₁ : Spec) (s₂ : Transcript s₁ → Spec) in ArkLib/Interaction/Reduction.lean
  • def OracleDecoration.answerQuery : in ArkLib/Interaction/Oracle/Core.lean
  • def liftAppendLeftContext : in ArkLib/Interaction/Oracle/Core.lean
  • abbrev OracleDecoration (spec : Spec) (roles : RoleDecoration spec) in ArkLib/Interaction/Oracle/Core.lean
  • theorem appendRight_range : in ArkLib/Interaction/Oracle/Core.lean
  • theorem PublicTranscript.liftAppend_split : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev Verifier (m : Type u → Type u) in ArkLib/Interaction/Reduction.lean
  • def mapOutput {m : Type u → Type u} [Functor m] in ArkLib/Interaction/Reduction.lean
  • theorem answerQuery_appendLeft : in ArkLib/Interaction/Oracle/Core.lean
  • def PublicTranscript.unliftAppend : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev protocolRoles : RoleDecoration protocolSpec in ArkLib/Interaction/Oracle/Examples.lean
  • def liftAppendRightContext : in ArkLib/Interaction/Oracle/Core.lean
  • def append {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • def toSpecRoles : (s : Oracle.Spec) → RoleDeco s → RoleDecoration s.toInteractionSpec in ArkLib/Interaction/Oracle/Spec.lean
  • def answerQuery : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev RoundTwoOracle in ArkLib/Interaction/Oracle/Examples.lean
  • def Reduction.execute {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • theorem simulateQ_cast_dep in ArkLib/Interaction/Oracle/Core.lean
  • abbrev stateChainCompWithRoles {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • abbrev firstRoundQuery (oracle1 : RoundOneOracle) (challenge1 : Challenge) in ArkLib/Interaction/Oracle/Examples.lean
  • theorem toInteractionSpec_append : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev roundOneOracleSpec : OracleSpec RoundOneQuery in ArkLib/Interaction/Oracle/Examples.lean
  • def RoleDeco.append : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev roundTwoOracleSpec : OracleSpec RoundTwoQuery in ArkLib/Interaction/Oracle/Examples.lean
  • theorem liftM_cast_query_add_right in ArkLib/Interaction/Oracle/Core.lean
  • abbrev protocolOracleDecoration : in ArkLib/Interaction/Oracle/Examples.lean
  • theorem simulateQ_liftAppendLeftContext_eq in ArkLib/Interaction/Oracle/Core.lean
  • abbrev protocolTranscript (oracle1 : RoundOneOracle) (challenge1 : Challenge) in ArkLib/Interaction/Oracle/Examples.lean
  • def toVerifier {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • abbrev VerifierOutput in ArkLib/Interaction/Oracle/Core.lean
  • def toReduction {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • abbrev Prover {ι : Type} (oSpec : OracleSpec.{0, 0} ι) in ArkLib/Interaction/Oracle/Core.lean
  • abbrev RoundOneOracle in ArkLib/Interaction/Oracle/Examples.lean
  • abbrev roundOneOracleDecoration : in ArkLib/Interaction/Oracle/Examples.lean
  • def PublicTranscript : Oracle.Spec → Type in ArkLib/Interaction/Oracle/Spec.lean
  • theorem answerQuery_appendRight : in ArkLib/Interaction/Oracle/Core.lean
  • def RoleDeco : Oracle.Spec → Type in ArkLib/Interaction/Oracle/Spec.lean
  • def QueryHandle.splitAppend : in ArkLib/Interaction/Oracle/Spec.lean
  • def projectPublic : in ArkLib/Interaction/Oracle/Spec.lean
  • def PublicTranscript.packAppend : in ArkLib/Interaction/Oracle/Spec.lean
  • theorem simulateQ_ext in ArkLib/Interaction/Oracle/Core.lean
  • abbrev stateChainComp {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • theorem mapOutput_id {m : Type u → Type u} [Functor m] [LawfulFunctor m] in ArkLib/Interaction/Reduction.lean
  • def CMvDegreeLE in ArkLib/Data/CompPoly/Basic.lean
  • def OracleDecoration.oracleContextImpl in ArkLib/Interaction/Oracle/Core.lean
  • instance instOracleInterfaceCDegreeLE [Semiring R] : in ArkLib/Data/CompPoly/Basic.lean
  • abbrev wit {StatementOut : Type u} {WitnessOut : Type v} in ArkLib/Interaction/Reduction.lean
  • theorem answerQuery_firstRound (oracle1 : RoundOneOracle) (challenge1 : Challenge) in ArkLib/Interaction/Oracle/Examples.lean
  • abbrev Response in ArkLib/Interaction/Oracle/Examples.lean
  • def toOracleSpec : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev protocolSpec : Interaction.Spec in ArkLib/Interaction/Oracle/Examples.lean
  • def compWithRoles {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • abbrev withRoles (m : Type u → Type u) in ArkLib/Interaction/Reduction.lean
  • abbrev liftAppend (s₁ : Spec) (s₂ : Transcript s₁ → Spec) in ArkLib/Interaction/Reduction.lean
  • def transcriptAppend : in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev Prover (m : Type u → Type u) in ArkLib/Interaction/Reduction.lean
  • def replay {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • def toInteractionSpec : Oracle.Spec → Interaction.Spec in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev liftAppendProd (s₁ : Spec) (s₂ : Transcript s₁ → Spec) in ArkLib/Interaction/Reduction.lean
  • def toMonadDecoration {ι : Type} (oSpec : OracleSpec.{0, 0} ι) in ArkLib/Interaction/Oracle/Core.lean
  • abbrev LawfulCommMonad (m : Type u → Type u) [Monad m] in ArkLib/Interaction/Reduction.lean
  • def Reduction.stateChainComp {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • def OracleCounterpart.mapOutput {ι : Type} {oSpec : OracleSpec.{0, 0} ι} in ArkLib/Interaction/Oracle/Core.lean
  • theorem simulateQ_cast_query in ArkLib/Interaction/Oracle/Core.lean
  • def Reduction.ofChain {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • theorem runWithRoles_compWithRoles_append in ArkLib/Interaction/Reduction.lean
  • def mapOutputWithRoles {m : Type u → Type u} [Functor m] in ArkLib/Interaction/Reduction.lean
  • def appendLeft : in ArkLib/Interaction/Oracle/Core.lean
  • abbrev roundOneTranscript (oracle : RoundOneOracle) (challenge : Challenge) : in ArkLib/Interaction/Oracle/Examples.lean
  • instance instOracleInterfaceCPolynomial [Nontrivial R] : in ArkLib/Data/CompPoly/Basic.lean
  • abbrev OracleProver {ι : Type} (oSpec : OracleSpec.{0, 0} ι) in ArkLib/Interaction/Oracle/Core.lean
  • abbrev roundTwoRoles (tr₁ : Interaction.Spec.Transcript roundOneTranscriptSpec) : in ArkLib/Interaction/Oracle/Examples.lean
  • def liftAppendLeftQuery : in ArkLib/Interaction/Oracle/Core.lean
  • def QueryHandle : in ArkLib/Interaction/Oracle/Spec.lean
  • def Strategy.ofChain {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • abbrev roundOneRoles : RoleDecoration roundOneTranscriptSpec in ArkLib/Interaction/Oracle/Examples.lean
  • abbrev InteractiveOracleVerifier {ι : Type} (oSpec : OracleSpec.{0, 0} ι) in ArkLib/Interaction/Oracle/Core.lean
  • def OracleDecoration.toOracleSpec : in ArkLib/Interaction/Oracle/Core.lean
  • def append : (s₁ : Oracle.Spec) → (PublicTranscript s₁ → Oracle.Spec) → Oracle.Spec in ArkLib/Interaction/Oracle/Spec.lean
  • def appendFlat {m : Type u → Type u} [Monad m] in ArkLib/Interaction/Reduction.lean
  • theorem simulateQ_cast_spec in ArkLib/Interaction/Oracle/Core.lean
  • def OracleDeco : Oracle.Spec → Type 1 in ArkLib/Interaction/Oracle/Spec.lean
  • abbrev stateChainFamily in ArkLib/Interaction/Reduction.lean

sorry Tracking

  • No sorrys were added, removed, or affected.

📋 **Additional Analysis**

Style and Naming Violations

  • Acronym Casing: In ArkLib/Data/CompPoly/Basic.lean, CDegreeLE, CMvDegreeLE, and IndividualDegreeLE violate the acronym rule ("Treat as words"). These should be renamed to CDegreeLe, CMvDegreeLe, and IndividualDegreeLe respectively.
  • Predicate Naming: IndividualDegreeLE (in Basic.lean) is an adjective-like predicate; it should follow the Prop-valued class convention and use the Is prefix (e.g., IsIndividualDegreeLe).
  • Line Length: Several files contain lines significantly exceeding the 100-character limit. For example, in ArkLib/Interaction/Oracle/Core.lean, lines 351, 375, and 482 exceed 200 characters.
  • Tactic Mode Formatting: by is often placed on the same line as the definition or match branch rather than at the end of the preceding line (e.g., Core.lean lines 198, 212, 224, 237).
  • Functional Syntax: The diff uses fun x => ... throughout. The guidelines state a preference for fun x ↦ ... (using the maplet symbol).
  • Copyright Consistency: ArkLib/Interaction/Oracle/Core.lean uses a copyright year of 2026, which appears inconsistent with ArkLib/Data/CompPoly/Basic.lean (2024-2025).

Documentation and Citations

  • Missing References Section: ArkLib/Interaction/Oracle/Core.lean includes academic citations in the text (e.g., [ACFY24], [BCIKS20]) but fails to provide the required ## References section in the module docstring header as per the Citation Standards.

📄 **Per-File Summaries**
  • ArkLib.lean: The changes update the ArkLib.lean manifest by adding new imports for composite polynomials and interactive oracle systems, including their core specifications, examples, and reductions.
  • ArkLib/Data/CompPoly/Basic.lean: This new file introduces degree-bounded subtypes for computable univariate and multivariate polynomials, along with several OracleInterface instances for polynomial evaluation. It defines the IndividualDegreeLE property and the CDegreeLE and CMvDegreeLE types to facilitate formal reasoning about polynomial degree bounds in oracle-based protocols.
  • ArkLib/Interaction/Oracle/Core.lean: This file establishes the core infrastructure for oracle-based interactions by bridging generic interaction specifications with the VCVio oracle computation model. It introduces definitions for OracleDecoration, path-dependent query handles, and interactive oracle-enabled provers, verifiers, and reductions, along with theorems for routing queries across appended transcripts. The implementation provides a complete formalization of round-by-round oracle access without any sorry or admit placeholders.
  • ArkLib/Interaction/Oracle/Examples.lean: This file introduces minimal examples of the oracle interaction framework, demonstrating how to define and compose multi-round protocols using Interaction.Spec and OracleDecoration. It includes new definitions for transcript specifications and query handles, as well as theorems proving that queries are correctly resolved within composed protocols, with no sorry or admit placeholders used.
  • ArkLib/Interaction/Oracle/Spec.lean: This file introduces the Oracle.Spec inductive type and associated infrastructure for defining oracle-based protocol specifications, distinguishing between public messages and oracle-accessible sender messages. It provides definitions for public transcripts, oracle query handles, and sequential protocol composition, along with theorems verifying the consistency of transcript manipulation. No sorry or admit placeholders are included.
  • ArkLib/Interaction/Reduction.lean: This file introduces a foundational framework for modeling interactive protocols through definitions of provers, verifiers, and reductions built on W-type interaction trees. It provides mechanisms for sequential and state-chain composition of protocols along with theorems for their execution, and it contains no sorry or admit placeholders.

Last updated: 2026-06-16 04:22 UTC.

lalalune referenced this pull request in lalalune/ArkLib Jun 5, 2026
# Conflicts:
#	ArkLib.lean
#	ArkLib/CommitmentScheme/Basic.lean
#	ArkLib/Data/CodingTheory/GuruswamiSudan/Basic.lean
#	ArkLib/Data/CodingTheory/GuruswamiSudan/GuruswamiSudan.lean
#	ArkLib/Data/CodingTheory/ProximityGap/BCIKS20/Curves.lean
#	ArkLib/Data/CodingTheory/ReedSolomon/FftDomain.lean
#	ArkLib/Data/MvPolynomial/LinearMvExtension.lean
#	ArkLib/Data/Polynomial/RationalFunctions.lean
#	ArkLib/OracleReduction/Execution.lean
#	ArkLib/ProofSystem/BatchedFri/Spec/General.lean
#	ArkLib/ProofSystem/Fri/Spec/SingleRound.lean
#	docs/wiki/README.md
#	docs/wiki/generated-files.md
lalalune referenced this pull request in lalalune/ArkLib Jun 5, 2026
… CompPoly)

These 4 self-contained modules (0 sorries) were absent from main despite the
PR #532 merge commit — the live rebase automation had reverted their content.
Restores ArkLib/Interaction/Oracle/{Core,Spec}.lean, Interaction/Reduction.lean,
Data/CompPoly/Basic.lean and registers them in the generated root.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lalalune referenced this pull request in lalalune/ArkLib Jun 7, 2026
…oParty

Reduces the Interaction/Reduction error count 55 -> 30. The remainder is an
API-redesign gap, not name resolution: the file targets Spec.Strategy.withRoles /
Spec.Counterpart / Spec.PublicCoinCounterpart which no longer exist in the
pinned PolyFun - the API moved to the SyntaxOver/ShapeOver/StrategyOver.TwoParty
forms (PolyFun 5d3a160). Migrating needs the PR #532 owner's design intent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants