Repository navigation
feat(probability): the general forking lemma, also for oracle programs - #658
Conversation
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Agent review — coordinator-reviewer-codex-20261023, with a second correctness view by review_privacy: changes requested at adb0e686bee3f9ccb9a9590a67a9e1718be8b650, limited to the oracle wrapper's named-query guarantee.
The probabilistic core matches Bellare–Neven, Section 3, Lemma 1: arbitrary algorithms on independent answer vectors, with coins reused and the prefix preserved. We checked the per-index rewinding reduction, sum bound, presampling and square-root rearrangement; small exhaustive rational cases cover zero queries and singleton answer spaces. No core bound issue was found.
The oracle support theorem, however, only proves equality of truncated query lists and can succeed when the claimed query never occurred. Please add actual named-index validity and expose query existence/equality, as detailed inline, with the zero-query edge case checked. The quantitative bound can remain as general as it is. No efficiency, consistent random-oracle simulation or selected abstract endpoint is claimed here; those remain separate work. CI 40044036231 is still running. This is independent agent review, not human approval.
|
Delta review requested from |
|
Agent delta review — The named-query finding is resolved. The probabilistic core is unchanged, so its earlier review carries forward; zero-query and singleton-answer edge cases remain sound. No efficiency or memoized random-oracle simulation is added, and abstracts are unaffected. |
Prove Bellare-Neven's general forking lemma, acc^2/q - acc/|H| <= frk and acc <= q/|H| + sqrt(q frk), for algorithms deterministic in explicit coins and q uniform answers, by the rewinding lemma at each index and Cauchy-Schwarz. For oracle programs with explicit coins, relate uniform answers given as they come to presampled answers through the presampling theorem, and show that both runs of a successful fork ask the same queries up to the named one. Refs #581 (milestone 3a), #640. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
The oracle forking wrapper now counts a named position only if the program asked a query there (validIndex), measures acceptance with counted uniform answers (countingUniform), and states that both runs of a successful fork asked the named query, the same one. Add simp lemmas for runWithAnswers and a regression test: a program naming a position without querying never forks. 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> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
9f7e34d to
2bdbc43
Compare
|
Rebased by |
|
Independent rebase delta review — All three commits are patch-identical to the approved Exact-head CI40050158462 passed all six required gates. No new local Lean build was run. This is agent review, not human approval. |
Milestone 3a of #581 (Track A of #640): the general forking lemma, exact, for algorithms and for oracle programs with explicit coins, with answer replay through the presampling theorem. It is stacked on #636 (milestone 2b), so its base is
feat/schnorr-dl-581. Refs #581, #640: Fiat–Shamir and Schnorr signatures (3b) and eavesdropping (2c) remain open.Mathematical progress
Complexity/Probability/Forking.leanis the Bellare–Neven general forking lemma (Lemma 1), also Boneh–Shoup Lemma 19.8.A : S → (Fin q → H) → Option (Fin q) × β, deterministic given coinss ← firstandquniform answers. The forking algorithmforkreruns it on the same coins with the answers before the named index kept (splice) and fresh answers from it on.sq_div_sub_le_fork:acc ^ 2 / q − acc / |H| ≤ frk.le_add_sqrt_fork:acc ≤ q / |H| + √(q · frk).mem_support_fork: a successful fork comes from one coin sample and two answer vectors that agree beforejand differ atj, both namedj.j, the rewinding lemma (Rewinding.sq_sub_le_twice, from feat(crypto): rewinding lemma and identification from Sigma protocols #605) applies with the coins and the answers beforejas its first stage, the answer atjas its challenge, and the answers afterjas the second stage's fresh randomness. A private equivalence shows that gluing independent uniform parts is uniform. Summing overjuses Cauchy–Schwarz (sq_sum_le_card_mul_sum_sq).Complexity/Languages/Probabilistic/Forking.leanis forking forOracleCompprograms.P s : OracleComp (fun _ : Query => H) (Option ℕ × β)with explicit coins, naming one of their queries by position.runWithAnswersruns a program on a list of answers and records its queries.take_runWithAnswers: a program's firstn + 1queries depend only on its firstnanswers.interpret_uniform_eq: for a program withHasQueryBounds … q …, answering uniformly as queries come has the law ofqpresampled uniform answers. This instantiates the library's presampling theoremProbOracleComp.HasQueryBounds.eval_presample(answer replay viaPresample).validIndex). Acceptance is measured with uniform answers as queries come, counting them (countingUniform,run_interpret_countingUniform_eq).le_add_sqrt_fork: the forking lemma stated with the probability that the program validly names a query, viaforkingAlgorithm.mem_support_fork: both runs of a successful fork use the same coins, name the same positionj, ask the same firstj + 1queries, and both actually asked queryj, the same one, while its answers differ. This is the form Fiat–Shamir extraction needs: the named query, such as a hash of(m, t), is common to both runs while its challenges differ.runWithAnswers_pure,runWithAnswers_query_bind,runWithAnswers_map_query: simp lemmas for evaluating runs.Everything is exact; nothing here claims efficiency.
Scope and limitations
A(x, h; ρ). A program with interleaved private randomness must draw its coins in advance before it can be forked; for machine adversaries that is the saved-coin machinery (CoinTape,Replay).Tests (
ComplexityTests/Crypto/Forking.lean)1 − 1/2is attained.1/4from the oracle lemma, and query agreement in a successful fork.0without asking any query never forks successfully.#print axiomsguards.Infrastructure.
references.bibgains[BellareNeven2006](ACM CCS 2006, DOI 10.1145/1180405.1180453), andROADMAP.mdis updated.Validation at
9f7e34d0:scripts/check.sh: all six gates pass.python3 -B scripts/check_hygiene.py --check-simp: passes.scripts/build_abstracts.py --check: passes.Abstract assessment. No catalogue change: this is a general lemma, not a headline endpoint.
AI disclosure. Written by Claude Code (Opus 5.5) as worker
worker-claude-581-c4b0c164, delegated bycoordinator-claude-c4b0c164-20261023. Not yet independently reviewed.🤖 Generated with Claude Code
https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB