Repository navigation
Nic's trick (formal: tighter soundness extractor) - #770
Merged
Merged
Conversation
The extractor's descent is correct with the opening's per-message errors unchanged, by an invariant whose bad set is empty at the start (the same MCA, fold, batching, OOD, query and tail events, used forwards). The new error terms are availability ones (every level's root, every fold challenge read from the adversary's queries), each at most 2^-125 and absorbed by the end statement's 2^14. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CertG P G lets the verifier accept from doom where the history satisfies G; Cert P is CertG P False, so every existing certificate is unchanged. final_ineq takes the extracted history failing G, and romSound_logG bounds acceptance with a doomed prefix and G failing. Spec.toCertG builds one from a specification whose returns in doom reject or satisfy G. This is what the agreement-set extractor's soundness needs: its doom holds at the root unconditionally, and an accepting run outside the escape events satisfies 'the descent of the final polynomial is valid'. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pairs card_foldBadR_le counts the challenges after which a tuple of the fold's list satisfies the new claim when every near pair of its agreement set (both halves of degree at most d, agreeing with the word on all of it but one point) satisfies Bp, given that every listed pair satisfying Bp violates the old claim. The MCA witness of a tuple is such a near pair, so the count is card_foldBad_le's over the pairs satisfying Bp. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TViol takes a predicate B on tuples: every listed tuple satisfying B violates the claim. A fold round pulls B back to the fold's tuples (pullT: if the tuple agrees with the fold on the round's threshold, every near tuple of the unfolded word satisfies B), and FoldRoundBound counts the escapes of the relativised invariant from the same MCA and claim events, so every escape bound is unchanged. A level's predicate passes to the next through the polynomial of a tuple's message and the high part (nextPred), and level 0's is 'every stack with the tuple's low parts is bad' (lvl0Pred). The opening is specified on ghost programs returning a trace of each level's rounds and high part and the final polynomial (whirLevelsG, verifyWhirG, verifyStackedOpeningG, equal to the verifier's once the trace is dropped). An accepting run need no longer be impossible from doom: it returns a good trace (traceGood), whose final polynomial's descent is not bad. With every bad stack violating a claim before the opening, an accepted proof's descent ends on a good stack. Downstream of Whir/Sound/Spec (Params, the assembly) is not yet adapted. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ce predicate The stack's root no longer creates 'no candidate satisfies the relation': its doom is the commitment's shape and word. The front phases run on the candidate the OOD answer leaves when it is bad (FrontIface takes any set of at most one, so it is unchanged), and the stacked opening on the bad stacks (OpeningIface.stackedSpec, now on the ghost opening, with the deployed TraceGood). The whole verifier has a ghost returning the announced sizes and the opening's trace (leanVmProgramG); its specification accepts from doom only good runs (GoodRun), through Spec.atRoot, which records that an accepting history is a run of the program. leanVmCert is a CertG with that predicate, every escape bound unchanged. The end theorem and the extractor are not yet adapted. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A good trace descends, round by round and level by level, to a level-0 list member whose stack is not bad (Whir.Sound.Descent), so at the deployed parameters some candidate of the stack's word satisfies the relation (OpeningIface.traceGood_cands). The end theorem now reads the new certificate: an accepted proof the extractor fails on is doomed past the stack's root and its extracted history is not a good run (doomed_of_not_extracted), which romSound_logG bounds with the same per-message errors. The list-decoding extractor is still the one the statement names; it finds the good candidate the descent ends on. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…new specifications Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
descendRounds and descendTrace compute the descent of a trace: at each round going back, on the agreement set of the current tuple with the fold (if it reaches the round's threshold), the near tuple of the unfolded word a NearDecoder returns; at each level boundary, the polynomial of the message and the high part. Near tuples on at least d + 3 columns are unique (nearT_unique), so on a good trace, with every round's threshold at least the level's degree plus three, the algorithm returns the tuple the existential descent reaches (descendTrace_of_traceGood), whatever sound and complete decoder it runs. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
descentOK checks that every level's degree plus three is at most its first round's threshold, kernel-checked at every admissible shape; codesOf_thr reads it on the codes, the hypothesis of descendTrace_of_traceGood. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
whirLevelsGF takes the final level's step after its rounds as a parameter: whirLevelsG is it at the full step (whirLevelsG_eq), and at finCut, which reads the final polynomial and returns the trace's leaf, it is the cut the extractor replays. after_whirLevelsGF_cut: wherever the full ghost returns a trace after a history, the cut returns the same trace after a prefix of it, so an honest prover need not have queried the permutations past the final polynomial. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CutRel p q: wherever p returns a value after a history, q returns it after a prefix. It passes through a common prefix program and through a final return, so the opening (verifyWhirCut, verifyStackedOpeningCut), the body (veBodyCut), verify_execution (verifyExecutionClaimsCut) and the leanVM verifier (leanVmProgramCut) cut the ghosts: on a prefix of every accepting run's history, the cut returns the run's data. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
XCut H F p q: wherever p's extracted run returns a value, q's does from the same state. Like CutRel it passes through a common prefix and a final return; with the full final step the cut's (xcut_fin), so the cut levels, opening, body and verifier (xcut_leanVmProgramG) all run to the accepting run's data. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…swers replayU runs a program with the permutation answered by a partial function, without commitments' words and with openings returned as the proof's leaves unverified (the sponge never absorbs them); replayIn lists the permutation inputs it makes. Where the extracted run returns, the replay returns the same value and state (replayU_of_xrun: an authenticated phase returns its leaves); answers agreeing on the replay's inputs give the same replay (replayU_congr). The agreement-set extractor replays the cut verifier on the adversary's permutation answers. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The final level's rest opens rows but commits nothing (NoCommitQ), so XCut now also gives a history the ghost's extends by no commitment. replayU_cut: where the ghost verifier's extracted run returns, the replay of the cut on permutation answers agreeing on its inputs returns the same value, at a state whose roots hold the commitments of the ghost's whole history. xrun_leanVmProgramG reads an accepting run as the ghost's. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without failure, a permutation entry whose answer's capacity an input carries comes before the input's entry, so a replay on the log's answers first logs its permutation inputs in the order it makes them (replay_chain): from a state holding the answer of entry i it ends holding the answer of an entry i' >= i, every input first answered in (i, i']. Once one is past the adversary's part of the log, so is every later one. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
XCut carries a condition on the cut's end state. Where the ghost verifier's run returns, the cut's run ends at a state from which the final query's proof of work, on the run's permutation answers, passes and draws a challenge naming the next phase's first positions, at the final level's depth and count of the announced shape's ladder (CutEnd, FinalShapeOK, FinalOK, GrindHit). The final level's depth is read off the ladder through the fold rounds' alphas (returns_foldRounds, returns_midTailPre, by the cost calculus's postconditions on returned values). Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s afresh Without failure, on an accepted proof, either the first k entries of the log answer the seed and every permutation input of the cut verifier's replay (Avail), or a permutation entry j >= k answers a hit of the final query's proof of work, read off the log before it (FinalHit): the seed's hash precedes its permutation, the replay's permutations follow it in order, and the final grind's permutation follows them (avail_or_hit). FinalShapeOK now states that the announced shape has a ladder. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
grindData reads, off a log's answers, the final proof of work's permutation input, the final level's query depth, the positions its first sample names and the phase they open; it persists on every longer log (grindData_append, through replayU_mono and absorb_mono: a returning replay's permutation inputs are answered). avail_or_hit's fresh hit is now at that input (FinalHit). Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A uniform answer passes the final query's 17-bit grind and names the final phase's first positions, at least 110 bits at every admissible shape (finalBits_all, decided over the ladders), with probability at most 2^-127 (sum_finalHit_div_le: the first positions fix the challenge's low bits). The final proof of work's input is a function of the log that persists as it grows, so a potential that starts at 2^-127 and never rises bounds a fresh hit by 2^-127 in all, not per query (prEvent_logged2_hit_le). The note's 117-bit claim was wrong: the minimum is 110 bits, at mu = 29, R = 4, and a union over the verifier's queries would not fit the statement's slack. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every commitment of a run costs two quarters, so a run of the verifier reads at most rootCap = leanVmCost / 2 roots (commits_length_le_of_costs). replayRoots are the roots the cut verifier's replay reads on the adversary's answers; a fresh hash answer of the verifier is one of them with probability at most rootCap 2^-256 per verifier query (prEvent_logged2_roots_le), the per-level generalization of prEvent_logged2_root_le. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
extractAS, over any near-tuple decoder: the seed and the cut verifier's replay on the adversary's answers, every root's word inverted through its hash answers, the descent of the replay's trace from the final polynomial, and the run of level 0's stack (tupleStack). extractAS_valid: without failure, on an accepted proof whose extracted history is a good run, when the adversary's answers cover the seed and the cut verifier's permutations and no hash entry past its log answers a root the replay reads, it returns a valid execution. descend_good: at the deployed parameters, the descent of a good trace ends on a stack that is not bad. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…racle model knowledgeSoundnessRomAS: for an adversary of at most Q queries, the verifier accepts while extractorAS D (the agreement-set extractor over any near-tuple decoder D, on the adversary's answers) does not return a valid execution with probability at most soundnessErrorAS Q: the random-oracle theorem's terms (a proof whose extracted history is not a good run is doomed at the stack's root, doomedRun_of_verify, split out of doomed_of_not_extracted), a fresh hit of the final proof of work (2^-127, once), and fresh roots (rootCap 2^-256 per verifier query). soundnessRpmAS_le_statement: with the transfer to the random-permutation model it stays within the end statement's (Q + 2^14) 2^-125 + 5 (Q + 2^14)^2 2^-256. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
classicalNearDecoder returns a near tuple when one exists, so the agreement-set extractor's knowledge soundness holds for at least one decoder outright. The statement's extractor needs a computable one. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In the transfer's random-oracle world, the two-oracle simulator queries F only at a forward query no edge holds yet and books the edge; inverse queries touch no oracle. So every cached F answer is the answer of the transcript's first forward query at its input (cacheF_firstForward, by the invariant FInv along the run). The agreement-set extractor in the random-permutation model reads the permutation's answers there (firstForward). Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ermutation model knowledgeSoundnessAS_holds: the end statement KnowledgeSoundness of Statement/LeanVm.lean holds for transcriptExtractorAS D, the agreement-set extractor over any near-tuple decoder on the transcript's Keccak-256 evaluations and first forward answers, with the statement's bound unchanged. The transfer is the list decoder's but for one step: the transcript's first forward answers extend the cache's F answers and the extractor is monotone in its permutation answers (extractAS_mono), so wherever the random-oracle extractor returns an execution the transcript's returns it too (romGame_leAS). Axioms: propext, Classical.choice, Quot.sound. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gaoNearDecoder decodes every lane of the word on the agreement set's points with CompPoly's Gao.decode at message length d + 1 and keeps the tuple if it is near. It is complete on at least d + 3 columns: a near tuple disagrees with each lane on at most one column, within Gao's radius, so Gao returns it (Gao.decode_eq_some). So knowledge soundness holds for the agreement-set extractor over an actual decoding algorithm. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The replay's roots are the body skeleton's commits: at most six, of height below 64 and width 8 to 128 at every admissible shape. A decoded trace is small. The finish is within finishPrice: level 0's shape, the words, the descent across levels, level 0's stack and the candidate run. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…k tree's Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… their lookups Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…keleton and decoders Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(N + 2^30)(D+2)^2(2^17 + 8D) Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…orL within asBudget Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d its budget Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ment-set extractor The Guruswami-Sudan list decoder, its compiled form and its price bounds are deleted; the shared parts of the old extractor are split out. LeanVM.transcriptExtractor is the agreement-set extractor and compiledKnowledgeExtractor its compiled program, priced within the new budget; the compiled chain is renumbered. Statement: the extractor's budget and size bound (25377), and the guest decoder's size bound (568917), its program smaller without the decoder. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TomWambsgans
force-pushed
the
agreement-set-extractor
branch
from
November 18, 2026 00:24
10c2f05 to
c91e7af
Compare
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dead code: Gao's decoder path, classicalNearDecoder, the CutRel relation, the Johnson threshold and the list-candidate bound (only the list decoder read them), the extractor-era lemmas of Sound/Extractor.lean, the intermediate extractors' knowledge-soundness theorems (one composition in Protocol/KnowledgeSoundness.lean now), five compiled wrappers the top never called (lvCC, wordsGoC, nEvalKC, seedMC, replayMC) and the bounds of dead functions. Reuse: after_ret_eq, returns_liftOption, capOf_duplexInput kept once, bind_le beside bind_cost, the existing size_vanRow, bitsToNat_lt, subtreeLeavesWith_mem_length, length_of_mapM, accumulateSide_length and wordBytes_length. The program's size is 25245 (30 indices without a body), within the statement's bound. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…orward answers The agreement-set extractor builds the transcript's preimage index once, at the roots' longest lookup (capOf), and every root reads its leaves through it (leavesIn; preimageIn_transcriptIndex_mono: an index at a larger length answers every shorter lookup as the shorter index does), and builds the index of the first forward answers once, its closures capturing it. The price is within 2^max(58, 2μ+9) + (N + 2^30)(D+2)^2(2^15 + 2D) (asBudget), within the statement's budget (asBudget_le_statement). Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…erm, size bound 25380 With one transcript index for every root and one index of the first forward answers, the price is within 2^max(58, 2μ+9) + (N + 2^30)(D+2)^2(2^15 + 2D), at most main's budget at every shape and number of queries. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, review fixes The statement's account of what 2^14 absorbs, and statement.tex's, follow soundnessErrorAS: a fresh root the extractor reads and a fresh hit of the final proof of work. The removed extractor's soundnessError and its corollaries go, LeanVM.lean pins soundnessRpmAS_le_statement. Stale references fixed; LoopLib and the root finders' imports removed. Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: scaraven <34778974+scaraven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TomWambsgans
marked this pull request as ready for review
November 18, 2026 10:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
formal: an agreement-set knowledge extractor
The knowledge extractor list-decodes level 0's word with Guruswami-Sudan at the Johnson threshold and runs every candidate. Its proved running time, in the cost machine's price, is
for a stack of
2^μwords and a transcript ofNpermutation queries (D = log₂(N+2) + 1). The first term is the list decoding:2^85atμ = 30, and never below2^80.This branch replaces it with unique decoding on transcript-pinned agreement sets (scaraven's "advice decoding"):
New bound. Decoding a lane costs
O(d²)and evaluating it on its level's domainO(n·d), withn = 2^(μ−6+R)andd ≈ 2^(μ−6)at level 0, across 126 lanes. The decoding term becomes about2^(2μ+7), and the transcript term is unchanged:That is
2^67instead of2^85atμ = 30, and2^39instead of2^80atμ = 16. With few queries, the bound is now driven by the stack size, not a fixed2^80floor.Soundness bound unchanged. The per-message errors are Annex B's: a too-small agreement set is the query event, and a spurious column is the MCA exceptional set. Two new terms come from the extractor reading only the adversary's queries:
2^-127, once;rootCap · 2^-256per query.