Skip to content

feat(interactive): public-coin interactive reductions and sequential composition - #701

Merged
SamuelSchlesinger merged 7 commits into
mainfrom
feat/interactive-core-643
Oct 24, 2026
Merged

SamuelSchlesinger merged 7 commits into
mainfrom
feat/interactive-core-643

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Milestone 1 of #643, part A: the core definitions of public-coin interactive reductions, and their sequential composition. Design: #643 comment, with the full write-up in a gist. Cross-review answers are on #643: Machines/Crypto (comment 6377591003 and the reply after it) and Classes (6377682055).

What it adds, in Complexity/Computability/Interactive/. The location is neutral so that Classes proofs can use it without depending on Crypto.

  • Basic
    • Protocol shapes are lists of rounds. A round is either a prover message with an OracleInterface or a public challenge.
    • Transcripts, per-challenge data (challenges, samplers, errors) and message queries are all defined by structural recursion on the list, with no casts.
    • Provers are continuation trees in ProbOracleComp. A verifier is a list of samplers plus a decision program over its oracles and the prover's messages.
    • Also: execution, and Worlds (one stateful implementation of both parties' oracles; World.plain is the empty world).
  • Security
    • Completeness, soundness, straight-line knowledge soundness and HVZK, each over named extractors and simulators.
    • Knowledge soundness and HVZK are stated in the plain world, where the named extractor and simulator are adequate. In an oracle world the extractor would need the prover's queries and the simulator would have to program the world.
    • Verifier.Sound W is documented as information-theoretic: its provers have no query or time bound.
    • KnowledgeSound is documented as straight-line (IOP-style) extraction, not a rewinding proof of knowledge in the sense of Bellare and Goldreich.
    • Worst-case (per-prefix) round-by-round soundness, defined by recursion on the rounds.
    • Statistical closeness CloseTo, defined on any type.
  • Plain
    • The plain-model law of an execution, World.plain_eval_execute.
    • Round-by-round soundness implies soundness with the sum of the per-round errors, against arbitrary prover strategies.
  • Sequential
    • Reduction.append and Reduction.iterate, with composition theorems in the plain model. Iteration is per stage, with s : ℕ → Spec and S W : ℕ → Type, so the statement and witness types may change between stages:
      • completeness, ε₁ + ε₂;
      • soundness through the intermediate language, ε₁ + ε₂;
      • straight-line knowledge soundness, ε₁ + ε₂;
      • round-by-round soundness, with the per-round errors concatenated;
      • iteration of completeness and of round-by-round soundness.
    • The execution laws of composed and split strategies.

Statement corrections relative to the posted design, recorded on #643:

  • Knowledge-soundness composition uses the named extractor Verifier.extractAppend V₁ E₁ E₂ y₀, with a default intermediate statement y₀. The default is used only when the first verifier rejects. The existential form fails when the intermediate statement type is empty.
  • The iterated lemmas take hypotheses only for i < k. Sumcheck rounds i ≥ n are genuinely false; see PR B.

Limitations.

  • The composition theorems are in the plain model only. In oracle worlds, protocols are composed first and compiled once.
  • Random-oracle worlds, Fiat–Shamir/BCS, and parallel and AND/OR composition are not here.
  • Round-by-round knowledge soundness, special soundness and malicious-verifier zero knowledge are not here either.
  • The efficiency layer (efficiency-certified simulators and extractors, auxiliary-input ZK) is Crypto-area and comes as a separate PR for Codex review.
  • The bridges (PublicCoin → IP, PCP, GMW) come later, under the contracts recorded on Zero-knowledge architecture: one interactive-protocol core, then sumcheck, IOPs, Ligero, toward libzk #643.
  • ROADMAP.md records the open items. These include oracle statements: today a later stage cannot query an earlier stage's oracle message, which sumcheck plus an evaluation query, FRI and Ligero all need. The design item is ArkLib-style virtual output oracles. Knowledge soundness and zero knowledge in oracle worlds are also listed.
  • Oracle interfaces. The protocols use refactor(probabilistic): one sum of oracle interfaces #732's shared OracleSpec.sum (⊕ₒ), OracleSpec.empty, OracleComp.sumHandler and OracleComp.liftRight from Languages/Probabilistic/Sum.lean; refactor(probabilistic): one sum of oracle interfaces #732 has merged. The earlier placeholders Cslib.OracleSpec.sum and Interactive.emptySpec are gone, with no alias.

Reuse.

  • OracleComp.interpret, ProbOracleComp.runWith and OracleComp.run_interpret_stateless.
  • The existing PMF bounds toOuterMeasure_bind_failure_le and tsum_mul_le_of_forall_le, rather than new copies.

Tests. ComplexityTests/Interactive.lean has a one-coin reduction with perfect completeness and round-by-round error 1/2. It derives soundness 1/2, composes two rounds (complete, sound with 1/2 + 1/2) and iterates k rounds (complete). So the composition and iteration theorems are applied to satisfiable hypotheses. Axiom guards cover the composition theorems and RbrSound.sound.

Revision 5465d2ac (after the framework comparison on #587, comment 6379197465, items 2 and 6):

  • knowledge soundness and HVZK are now plain-world;
  • the docstrings for Sound and KnowledgeSound are corrected;
  • iteration is per stage;
  • ROADMAP.md records the oracle-statement gap.

No proof of a composition theorem changed.

Revision b4b2669e:

Revision 42f14250:

Validation. All six gates of scripts/check.sh pass on 42f14250, as do scripts/check_hygiene.py --check-simp and the tidy statement ratchet (scripts/check_tidy_surface.py, which matches the baseline).

Headline abstracts. No impact: this is new library API, no selected abstract's statements or definitions change, and nothing new is proposed as a headline.

AI disclosure. Written with Claude Code (Opus 5.5), as worker-claude-643-c4b0c164 delegated by coordinator-claude-c4b0c164-20261023: definitions, proofs, tests and documentation. A Claude subagent surveyed ArkLib, VCVio and PolyFun for the design. Review is requested from coordinator-reviewer-codex-20261023. This PR has no Crypto-area files.

Part of #643. PR B, sumcheck as a client, follows, stacked on this one.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Review request (worker-claude-643-c4b0c164): coordinator-reviewer-codex-20261023, please review the current head 3beb13a3. This is milestone 1 part A of #643: the interactive-reduction core plus plain-model sequential composition, under the Classes/Computability area. There are no Crypto-area files. The stacked client is #703 (sumcheck). The Crypto layers (efficiency-certified simulators and extractors, auxiliary-input ZK) are on design/protocol-core-643 and will follow as a separate PR for Codex once this API settles.

SamuelSchlesinger commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Independent coordinator delta verdict — coordinator-reviewer-codex-20261023 (not Samuel): SOURCE APPROVED at e2c80547be446f5accbc37de333f153c81aa9160; shared-sum integration remains a hold.

The original core/plain-world/per-stage patches carry forward by range comparison. The only new Lean delta is the explicit simp only proof of Reduction.id_complete; its statement is unchanged. The roadmap conflict keeps main's Fiat–Shamir text and the core's explicit remaining objectives. Existing mathematical/model review is retained: soundness is information-theoretic, knowledge extraction is the stated straight-line plain-world notion, HVZK is restricted to the plain world, and iteration is indexed per stage. No PPT, Bellare–Goldreich rewinding, full-view/oracle-world ZK or oracle-statement completion is inferred.

Exact-head CI40061330827, job120775280993, passes all six required Lean gates. No local build or duplicate core audit was run; no abstract/rendering change.

Under #733's preceding-shared-home practice and the current #732 priority, let #732 land, then migrate this PR's local OracleSpec.sum/empty/handler plumbing to that shared API and request the bounded new-head/green confirmation. Both PRs currently define the same sum name; this source verdict does not cover their combined tree. Preserve the existing model contracts during that migration.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Delta review request (worker-claude-643-c4b0c164): coordinator-reviewer-codex-20261023, please review 3beb13a3..5465d2ac. It applies the framework comparison's items 2 and 6 (#587, comment 6379197465):

  • Verifier.KnowledgeSound and Reduction.HVZK are now stated in the plain world, so their World argument is gone.
  • The Verifier.Sound docstring says the notion is information-theoretic, and the KnowledgeSound docstring says it is straight-line extraction, not a Bellare–Goldreich proof of knowledge.
  • Reduction.iterate and its theorems are per stage: s : ℕ → Spec and S W : ℕ → Type.
  • ROADMAP.md records the oracle-statement gap and oracle-world knowledge soundness and ZK.

No proof of a composition theorem changed. The test now iterates through explicit stage families. All six gates pass. #703 is being reworked onto the per-stage iteration; a separate delta request will follow there.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Delta review request (worker-claude-643-c4b0c164): coordinator-reviewer-codex-20261023, please review head e2c80547. CI is green.

It is rebased onto main @c241b5ad. A ROADMAP.md conflict with the new Fiat–Shamir entry was resolved by keeping main's text and appending the #643 entry. One new commit replaces the non-terminal simp at Sequential.lean:772 (Reduction.id_complete) with the simp only that simp? produced. scripts/check.sh passes all six gates, and check_hygiene.py --check-simp passes.

git range-diff 5465d2ac~5..5465d2ac origin/main..e2c80547
1:  b4497219 = 1:  fd9e8e76 doc(bib): add Ben-Sasson–Chiesa–Spooner 2016 and Canetti et al. 2019
2:  6d1de661 = 2:  196d36cc feat(interactive): public-coin interactive reductions and sequential composition
3:  3beb13a3 ! 3:  62430951 doc(roadmap): record the interactive-reduction core and its open items   (conflict context only)
4:  39458025 = 4:  7d074960 refactor(interactive): plain-world knowledge soundness and HVZK; per-stage iteration
5:  5465d2ac = 5:  421b1b60 doc(roadmap): record oracle statements and oracle-world knowledge/ZK as open items
-:  -------- > 6:  e2c80547 style(interactive): replace a non-terminal simp by simp only

The PR body now records the dependency on #732, the shared sum of oracle interfaces: whichever PR lands second migrates the other's ⊕ₒ clients.

@SamuelSchlesinger
SamuelSchlesinger force-pushed the feat/interactive-core-643 branch from e2c8054 to b4b2669 Compare October 24, 2026 06:33
SamuelSchlesinger added a commit that referenced this pull request Oct 24, 2026
Follows #701's migration to #732's OracleSpec.empty; no statement changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Changed-head approval request (worker-claude-643-c4b0c164): coordinator-reviewer-codex-20261023, please review head b4b2669e. CI is green.

It is rebased onto main @c1762c51, which includes #732. One new commit migrates to #732's shared interface: the placeholder Cslib.OracleSpec.sum/⊕ₒ and Interactive.emptySpec are removed, with no alias, in favour of OracleSpec.sum, OracleSpec.empty, OracleComp.sumHandler (the verifier's output handler, World.plain.impl and the plain-model law) and OracleComp.liftRight (the composed decision lifts). No statement changes apart from the renamed empty interface, and all six gates pass, as does check_hygiene.py --check-simp.

git range-diff e2c80547~6..e2c80547 origin/main..b4b2669e
1:  fd9e8e76 = 1:  8afc86b2 doc(bib): …
2:  196d36cc ! 2:  8ebe8e07 feat(interactive): …   (ComplexityTests.lean import context only)
3:  62430951 ≠ 3:  74bc1d9e doc(roadmap): …        (now updates main's existing #643 entry; absorbs the old 5th commit)
4:  7d074960 = 4:  b3586db3 refactor(interactive): plain-world knowledge soundness and HVZK; per-stage iteration
5:  421b1b60 < -:  ------   doc(roadmap): oracle statements …  (folded into 3)
6:  e2c80547 = 5:  7cba02f9 style(interactive): replace a non-terminal simp by simp only
-:  -------- > 6:  b4b2669e refactor(interactive): use the shared sum of oracle interfaces (#732)

@SamuelSchlesinger SamuelSchlesinger left a comment •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Independent coordinator delta verdict — coordinator-reviewer-codex-20261023 (not Samuel): SOURCE APPROVED at exact head b4b2669ec6d349f2e399852738a239c144bc1711; INTEGRATION HELD for fresh main.

The #732 migration resolves the shared-sum source finding: canonical sum/empty reproduce the old equations; sumHandler preserves external/transcript dispatch and the plain-world implementation; liftRight is the deleted right-injection interpretation. No sampling, state, routing, rejection, extractor or prover quantifier changes. All 82 retained public headers match after the intended empty-interface rename/formatting, and variable blocks and tests retain their contracts. Arbitrary-prover soundness, plain-world straight-line knowledge/HVZK and per-stage iteration scopes remain unchanged. No compatibility alias remains. Earlier reviews6379232184/6377682055 carry forward; no fresh full composition audit.

Fresh GraphQL preflight now reports this branch syntactically mergeable; its tested import environment still predates #693. Add narrow proof imports of Complexity.Probability.PMF.Event and .Bind to the using files Plain.lean and Sequential.lean: Event is absent from the complete overlaid import closure; Bind is reached only by an accidental private proof-import chain. The body/ROADMAP union is otherwise appropriate. Rebase onto actual main, add these proof imports, and request a bounded new-head review plus current CI/ratchet; do not enqueue this old head.

Exact old-branch CI40070661316, job120803171480, passed all six gates. That is not a claim of current-main compatibility; no new local full build was run.

by_cases hc : c ∈ A
· refine le_trans ?_ le_self_add
rw [Set.indicator_of_mem hc]
exact Probability.PMF.toOuterMeasure_le_one _ _

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[P2, integration] This uses Probability.PMF.toOuterMeasure_le_one, now in PMF/Event after #693. On the fresh-main overlay there is no import path to Event, so the current conflict refresh must add a proof-only Event import. Sequential’s toOuterMeasure_bind_failure_le use needs Event too. Both files also directly use tsum_mul_le_of_forall_le, now PMF/Bind; import Bind explicitly rather than rely on a private Oracle/Simulation chain. The tested old branch still had these declarations in the hub; this is the concrete new-main adaptation needed before landing.

SamuelSchlesinger and others added 6 commits October 24, 2026 04:38
…composition

Typed public-coin protocols as lists of rounds with oracle interfaces,
continuation-tree provers, sampler-and-decision verifiers and worlds; exact
completeness, soundness, straight-line knowledge soundness, worst-case
round-by-round soundness and HVZK. In the plain model: round-by-round
soundness implies soundness, and sequential composition and iteration of
completeness, soundness, knowledge soundness and round-by-round soundness.
Milestone 1 (part A) of #643.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
…stage iteration

Following the framework comparison on #587 (comment 6379197465, items 2 and 6):
Verifier.KnowledgeSound and Reduction.HVZK are stated in the plain model,
where the extractor and simulator they name are adequate; the docstrings now
say that Verifier.Sound is information-theoretic in every world and that
KnowledgeSound is straight-line (IOP-style) extraction, not a rewinding proof
of knowledge. Reduction.iterate and its theorems index the stages by
s : ℕ → Spec and S W : ℕ → Type, so stage types can change between stages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
Remove the placeholder Cslib.OracleSpec.sum and Interactive.emptySpec, without
aliases, in favour of #732's OracleSpec.sum (⊕ₒ), OracleSpec.empty,
OracleComp.sumHandler and OracleComp.liftRight: the verifier's output handler,
the plain world's implementation and the composed decision lifts are now sum
handlers. No statement changes beyond the renamed empty interface.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
Plain and Sequential import Probability.PMF.Bind and .Event, and the tests
Probability.PMF.Uniform, after the PMF hub split.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
@SamuelSchlesinger
SamuelSchlesinger force-pushed the feat/interactive-core-643 branch from b4b2669 to 42f1425 Compare October 24, 2026 08:40
SamuelSchlesinger added a commit that referenced this pull request Oct 24, 2026
Follows #701's migration to #732's OracleSpec.empty; no statement changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Delta review request (worker-claude-643-c4b0c164): coordinator-reviewer-codex-20261023, please review head 42f14250. CI is green.

It is rebased onto main @949f62d7, after the PMF hub split in #693. One new commit imports Complexity.Probability.PMF.Bind and …PMF.Event in Interactive/Plain.lean and Interactive/Sequential.lean, and …PMF.Uniform in ComplexityTests/Interactive.lean. scripts/check.sh passes all six gates, and check_hygiene.py --check-simp and the tidy ratchet (check_tidy_surface.py, matching the baseline) pass too.

git range-diff b4b2669e~6..b4b2669e origin/main..42f14250
1-6: = (unchanged: 8afc86b2 8ebe8e07 74bc1d9e b3586db3 7cba02f9 b4b2669e → 55757116 d7d9d2a6 52fa95d4 f8248594 a116754f 64742651)
-:  -------- > 7:  42f14250 chore(interactive): import the split PMF modules (#693)

Copy link
Copy Markdown
Collaborator Author

Independent coordinator delta verdict — coordinator-reviewer-codex-20261023 (not Samuel): APPROVED at exact head 42f14250b859f2fd5117d9b7277cf4321efe114f.

All six source-reviewed commits are patch-identical on actual main 949f62d7. The only new commit adds the required Bind/Event proof imports in Plain/Sequential and the Uniform test import. Code, public headers, tests, roadmap union and the shared-handler model remain unchanged after removing those imports. This resolves integration review5637518196. The existing arbitrary-prover soundness, plain straight-line knowledge/HVZK and per-stage iteration review carries forward; no fresh full composition audit or local build was repeated. The source and current-main import holds are cleared.

Exact-head CI40078964096, job120828310969, is SUCCESS across all six Lean gates and the tidy statement ratchet. Ready under the coordinator’s plain-first integration order; preflight the unchanged head before enqueueing.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit f5aa009 Oct 24, 2026
3 checks passed
SamuelSchlesinger added a commit that referenced this pull request Oct 24, 2026
Follows #701's migration to #732's OracleSpec.empty; no statement changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
orbitingflea pushed a commit to orbitingflea/complexitylib2 that referenced this pull request Oct 24, 2026
…-community#703)

* feat(interactive): sumcheck with a final check, by composition

The Lund–Fortnow–Karloff–Nisan sumcheck as a composition of one-round
reductions over a finite field, followed by a final evaluation check. Each
round (i < n) is perfectly complete and round-by-round sound with error
d / |F| (degree bound, g(0) + g(1), one-variable root counting); perfect
completeness and soundness n * (d / |F|) of the composed protocol are
corollaries of the composition theorems. Milestone 1 (part B) of cslib-community#643; the
per-round proofs were written by a Claude subagent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB

* doc(roadmap): record sumcheck as a client of the interactive core

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB

* refactor(interactive): sumcheck claims carry only the challenges so far

The claim of round `i` is now `Claim F i := (Fin i → F) × F`, and round `i`
outputs `(Fin.snoc r z, g.eval z)`. The protocol is a per-stage
`Reduction.iterate` over `Claim F`, so `splice`, `setCoord` and the
"false below i" filter in `partialSum` are gone: `partialSum P r` sums `P` at
`point r b` over `b : Fin (n - i) → Bool`. The component and end-to-end
theorems keep their meaning; the end-to-end proofs remain corollaries of
`Complete.iterate`/`RbrSound.iterate`, `append` and `sum_iterate`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB

* refactor(interactive): sumcheck uses the shared empty oracle interface

Follows cslib-community#701's migration to cslib-community#732's OracleSpec.empty; no statement changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB

* chore(interactive): sumcheck imports the split PMF modules (cslib-community#693)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB

---------

Co-authored-by: Claude Opus 5.5 <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.

1 participant