feat(oracle-reduction): worst-case round-by-round security + ProtocolSpec RBR game glue [ABF26 split 1/4] - #668
feat(oracle-reduction): worst-case round-by-round security + ProtocolSpec RBR game glue [ABF26 split 1/4]#668alexanderlhicks wants to merge 13 commits into
Conversation
…Spec RBR game glue Splits the framework layer out of #505 (feat/abf26-plan) as the first of four stacked sub-PRs, rebuilt directly on top of current main. New math: * `Verifier.rbrSoundnessWorstCase` / `rbrKnowledgeSoundnessWorstCase` — the paper-shape (ABF26 Def A.5) worst-case-per-prefix round-by-round definitions, quantified over every fixed transcript prefix rather than a prover-sampled one. * `rbrSoundnessWorstCase_implies_rbrSoundness` and its knowledge analogue, which discharge ArkLib's existing averaged forms from the worst-case ones with the same error constants (averaged <= worst-case is the safe direction). * `ArkLib/ToVCVio/OracleComp/RbrGame.lean` — ArkLib-specific `ProtocolSpec` glue factoring the rbr games into per-round challenge bounds, plus the `OptionT` challenge-first master bounds and two `loggingOracle` lemmas. Upstreaming cleanup (VCVio pin cbd4144b already provides these): * Delete `ArkLib/ToVCVio/ToMathlib/Control/StateT.lean`; `SimulateQ.lean` now imports VCVio's `ToMathlib.Control.StateT` and uses `StateT.run'_map'`. KZG call sites follow. * Drop the 29 `SimulateQ.lean` lemmas and 3 `RbrGame.lean` `probEvent_bind_le_*` lemmas that VCVio upstreamed between 5f7707fb and cbd4144b; several carried "upstream VCV-io candidate" docstrings and were duly upstreamed. Also removes a misleading `stop`-quarantined proof body in `RoundByRound.lean`, leaving a documented `sorry`, and documents that the pre-existing `@[simp]` wip lemma `Reduction.runWithLog_discard_logs_eq_run` propagates `sorryAx` to downstream `simp` proofs. No new proof-term sorries. Build green (4122 jobs); all new declarations axiom-clean ({propext, Classical.choice, Quot.sound}). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Documentation-accuracy fixes from PR-0's adversarial review gate (29 findings raised, 8 confirmed, all low severity and doc-only; zero defects confirmed in the mathematics, proofs, axiom hygiene, or split integrity). * F1 `ToVCVio/README.md` listed `OracleComp.bind_liftComp_map` as removed while it was still defined in `SubSpec.lean`. Delete it — zero call sites tree-wide, duplicates Mathlib's `bind_map_left`, and #505 deletes it too. `SubSpec.lean` becomes a compatibility shell, matching main's existing convention for fully-upstreamed files. * F2 `RbrGame.lean` claimed present-tense use by `ToyProblem/**` paths that do not exist until a later sub-PR. Rewritten as forward references, and a staging note in the module header now says which declarations land ahead of their consumers and which one is consumed today. * F3 `ToVCVio/README.md` shipped pre-stale: the "pin predates these" claim was false for three empty compatibility shells, the staging section still gave a "PR pending / delete at the next bump" directive for work already upstreamed in `962e446` (ancestor of pin `cbd4144b`), and it named the old 4.30 pin. * F4 `Probability.prob_tsum_form_singleton` -> `prob_tsum_form_singleton`; no `namespace Probability` exists on main (a feat/abf26-plan artifact). Also notes the pre-existing one-shot implication as `(admitted)` in its docstring, matching the honesty note this branch adds in `Execution.lean`. Build green (4122 jobs); axiom probe re-run after fixes: 13/13 {propext, Classical.choice, Quot.sound}, zero sorryAx. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…patibility shell
Completes the v4.31.0 dedup pass. `simulateQ_randomOracle_map_uniformFin` was the
one declaration in this file that did NOT trigger an "already declared" error, so
the earlier pass kept it. It is nonetheless an exact duplicate: VCVio's copy in
`VCVio/OracleComp/QueryTracking/RandomOracle/Simulation.lean` is identical in
statement AND proof, down to already using `StateT.run'_map'`.
It escaped detection because both copies sit at root scope in *different* modules:
this file imported `RandomOracle/Basic`, never `RandomOracle/Simulation`, so the
two names never met and the compiler had nothing to complain about. A duplicate
that is merely out of scope still violates the no-duplication guardrail.
Fix: import `RandomOracle/Simulation` instead, so the sole consumer
(`Commitments/Functional/KZG/Sampling.lean:56`) resolves to VCVio's version, and
reduce this file to a compatibility shell like `Coercions/SubSpec.lean`.
So the tally is 30 of 30 declarations upstreamed here, not 29.
Build green (4122 jobs); axiom probe 13/13
{propext, Classical.choice, Quot.sound}, zero sorryAx.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…tive docs
Acting on a fresh adversarial review of this PR. Both removals were verified to
have zero *tactic* call sites anywhere, including on the source branch
feat/abf26-plan — only docstring mentions, which is precisely the failure mode
ArkLib's own "verify a live consumer before building" lesson warns about.
* Remove `ProtocolSpec.probEvent_optionT_simulateQ_addLift_getChallenge_first_bind_le_add`.
Its sole live sibling `..._le_convex` is a strict sharpening (differs by exactly
ε₁·ε₂) and is what the branch's knowledge-soundness proof actually calls; the
additive form is recoverable from it in a few lines if ever needed. Two prose
pointers that named it — including the `_prefix_getChallenge_bind_le` docstring
and the `_le_convex` docstring — now name `_le_convex`.
* Remove `Prover.runToRound_succ`. No consumer on any ref; the proofs it was
written for use `Fin.induction_three`. One-line proof, trivially re-added when a
caller appears. Fixed the sibling docstring that referenced it.
* `RbrGame.lean` staging note claimed the unreferenced declarations were
"deliberately unreferenced rather than dead". That was true of the rest but false
of `_le_add`; the note now states the check applied (a live tactic call site on the
parent branch, not a docstring mention) and records the one member that failed it.
* `ToVCVio/README.md` was written relative to feat/abf26-plan rather than to this
PR's baseline, so it documented deletions this PR does not make
(`OptionT.failure_bind`, `Pr_eq_tsum_indicator`, "29 SimulateQ lemmas", "three
probEvent_bind_le_* lemmas" — none of which exist on the baseline). Rewritten to
list the three real deletions, with an explicit caveat that the larger ~550-line
dedup is code *not added* rather than code removed. Added `SimulateQ.lean` to the
compatibility-shell list.
Build green (4122 jobs); axiom probe 12/12
{propext, Classical.choice, Quot.sound}, zero sorryAx.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
These files are destined for main, where "the ABF26 split", "a later sub-PR", branch names, dated review findings and internal audit labels are meaningless or actively misleading. Rewritten so each docstring stands on its own and stays true after the surrounding work is forgotten. Removed as ephemeral: * `RbrGame.lean` — the whole "Staging note" (first sub-PR / lands ahead of its consumers / checked against parent branch feat/abf26-plan) and both "consumer lands in a later sub-PR of the ABF26 split" pointers. Replaced with what the lemmas are *for*: the plain knowledge-soundness game is Option-valued and draws its challenge first, which is why the rbr master bound does not apply. * `RoundByRound.lean` — "Recorded 2026-07-18 (review finding B05)" and the `present-but-different` coverage label, which are internal review vocabulary. Replaced with actionable guidance: prefer proving the worst-case form, it is strictly easier (no prover quantifier) and yields the averaged form; the implication runs one way only. * `Execution.lean` — dropped the dated Phase-A audit citation and the reference to a ToyProblem surface that does not exist here. The `@[simp]`+`sorry` hazard is now stated as a standing instruction to check `#print axioms`. * `ToVCVio/README.md` — was largely a dated changelog (staging state, VCVio branch and commit hashes, history notes). git log is the authority for that. Rewritten as a durable policy doc: what the directory is for, the upstream-then-delete rule, and two real gotchas — upstream lemmas are often more general so call sites need named arguments, and a green build does not prove the absence of duplicates. No reference to `ProofSystem/ToyProblem/**` survives anywhere in the diff, since that module does not exist on main. What remains is paper citations (ABF26 Def A.5, Lemma 6.10), one toolchain version, and one merged-PR pointer. Build green (4122 jobs). Docstrings only; no statement or proof changed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two tracked docs make claims this PR falsifies.
* `docs/kb/audits/open-problems-list-decoding-and-correlated-agreement.md` recorded
"Definition A.5 round-by-round knowledge soundness" as `present-but-different`,
citing only `rbrKnowledgeSoundnessOneShot` / `rbrKnowledgeSoundness` and noting
ArkLib had it "in a more abstract transcript/state-function framework". That was
accurate before this PR and is not after: `rbrKnowledgeSoundnessWorstCase` is the
paper shape. Promoted to `present` per the file's own legend ("a close match in
ArkLib"), citing the new definition and recording that the averaged variants still
exist and are derived from it with the same error constants.
* `docs/wiki/repo-map.md` described `ArkLib/ToVCVio/` as being for "reusable VCVio
helper lemmas before they are upstreamed". That no longer covers the directory:
`OracleComp/RbrGame.lean` mentions ArkLib's `ProtocolSpec` and can never be
upstreamed, and five files are now import-only compatibility shells. Extended, with
a pointer to the directory README for the upstream-then-delete rule.
Deliberately NOT updated:
* `docs/kb/_generated/**` still lists the removed `bind_liftComp_map`. That is correct
— `.github/workflows/ci.yml` blocks committing generated KB files from feature PRs;
`kb-generated.yml` refreshes them separately.
* The blueprint needs nothing: no `\lean{}` reference points at any declaration this
PR removes (checked for all seven).
`validate.sh --docs` green: markdown link integrity passes, including the new
cross-directory link.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
🤖 PR SummaryFailed to generate AI summary. Please check the per-file summaries and statistics below. Statistics
Lean Declarations ✏️ Removed: 3 declaration(s)
✏️ Added: 16 declaration(s)
📋 **Additional Analysis**Multiple guideline violations found. The diff introduces 📄 **Per-File Summaries**
Last updated: 2026-07-25 05:58 UTC. |
…ndness
Closes the long-standing admit, and the two `sorry`s in
`KnowledgeStateFunctionOneShot.toKnowledgeStateFunction.toFun_next` that blocked
it. All three were pre-existing; the whole one-shot cluster has no consumer
outside this file, so the supporting definitions were free to change.
The admit was not merely unfinished — it was unprovable as set up. A
`KnowledgeStateFunction`'s round-0 obligation is `(stmtIn, extracted) ∈ relIn`
(forced by `toFun_empty`), but `toRoundByRound.extractMid` hands back its `witIn`
argument at that step, and that argument is universally quantified: an adversary
may supply an invalid witness. Two changes fix it.
* New `Extractor.RoundByRoundOneShot.toRoundByRoundOfRel`, which selects a witness
valid for `relIn` whenever one exists. The choice is classical, which costs
nothing: `extractMid` is a function, not an algorithm. It needs `relIn`, so it
cannot live in the relation-agnostic `toRoundByRound`, which is left untouched.
* `toKnowledgeStateFunction`'s state function now carries the disjunct
`∃ v, (stmtIn, v) ∈ relIn` at nonzero rounds, replacing a disjunct about the
extractor's output at that round — which was unusable, since nothing relates the
extractor at round `m+1` to the extractor at round `m`.
Together these make the general bad event imply that `relIn` holds **no** witness
for `stmtIn`. That is what bridges to the one-shot event, whose extra conjunct says
the extractor fails on the prover's query log: the general event cannot mention a
query log at all, since `extractMid` never receives one, but with no witness in
existence the conjunct holds for free regardless of the log.
Also adds `KnowledgeStateFunctionOneShot.toFun_empty_of_eq_zero`, the transported
form of `toFun_empty` for an index merely *equal* to `0`, which is the form
round-by-round arguments need.
Build green (4122 jobs). `#print axioms` on the theorem and all three supporting
declarations: {propext, Classical.choice, Quot.sound}, zero sorryAx.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
🤖 PR Summary
Let me examine the per-file summaries and the body to identify the key additions and changes. Files changedLet me categorize. Mathematical Formalization
Proof Completion (sorries removed)
No new sorries — the file says "Three pre-existing Infrastructure / CI
Refactoring / Mechanical changes
Documentation
Review flags
Now I will write the overview. """ Mathematical Formalization
Proof Completion (sorries removed)
Upstreaming cleanup / Compatibility shells
Infrastructure / CI
Documentation
Verification
Statistics
Lean Declarations ✏️ Removed: 3 declaration(s)
✏️ Added: 18 declaration(s)
✏️ Affected: 1 declaration(s) (line number changed)
✅ Removed: 3 `sorry`(s)
📋 **Additional Analysis**Changes are relevant to ArkLib contribution guidelines; several naming and documentation issues found. See table and notes below. 📄 **Per-File Summaries**
Last updated: 2026-07-26 06:36 UTC. |
`ABF26` has no entry in `blueprint/src/references.bib`, so as a bare prose tag in
core framework files it points nowhere a reader can follow. The definitions carry
their own mathematical content — worst-case-per-prefix quantification, stated in
full in the surrounding prose — so the attribution added nothing a citation-less
reference could deliver.
Removed all three occurrences in `OracleReduction/Security/RoundByRound.lean`
("paper shape, e.g. ABF26 Definition A.5" in the section header and in both
worst-case definitions), rewording to "the standard literature shape". Also the
one in `ToVCVio/OracleComp/RbrGame.lean` ("ABF26 Lemma 6.6"), which is the same
issue and would otherwise be left inconsistent.
No `ABF26` reference now survives anywhere in the PR's Lean sources. The paper
audit under `docs/kb/audits/` still cites it, correctly — comparing ArkLib against
that paper is precisely what that document is for.
Build green (4122 jobs). Docstrings only.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
/review |
🤖 AI ReviewReviewed at commit Unguided review — no extra instructions; grounded only on the diff, the repository dependency graph, and any cited references. Verdict (deterministic): Needs Minor Revisions Basis:
Overall Summary: Mechanical Pre-Check Results: Pre-existing escape hatches in touched files (context only, does not affect verdict):
Checklist Coverage: The PR covers all Specification Checklist items. Reviewers verified the worst-case-per-prefix definitions ( Cross-File Issues: Cross-file wiring is correct: 💡 Key Lean 4 / Mathlib Issues (advisory synthesis context)
The deterministic verdict and basis above are authoritative; this synthesis is context only. Synthesis Agent Assessment: Needs Minor Revisions 📚 References & context usedKnowledge base / specification (2):
Repository context provided (50 file(s) from the dependency graph; large sets may be trimmed to fit the model's budget):
🔍 **Mechanical Pre-Check Results**Pre-existing escape hatches in touched files (context only, does not affect verdict):
🔗 **Cross-File Analysis**Cross-File Analysis: Main composition chains:
Type-flow analysis:
Axiom/sorry propagation:
Multi-file coordination check:
Let me check for potential issues:
Let me check for the Looking at potential cross-file issues:
Let me verify the key wiring in the implication theorems more carefully: In
This matches the In
The Wait, let me recheck more carefully. The game shape in So In the event, This all looks correct. Now let me check if there are any potential issues with the The
The One thing I notice: in the Let me also check the The proof:
The key step is deriving The final step constructs the one-shot event with three components:
This matches the one-shot event structure: I don't see any obvious correctness issues in the cross-file wiring. The main things to verify would require checking that VCVio lemmas like One thing I should check: the Let me also check the Actually, wait - looking at the Let me also verify the Overall, I don't see significant cross-file composition issues in this PR. The main changes are:
The pre-existing One potential concern: the Let me also check if the I believe the PR is well-structured and the cross-file wiring is correct. The main mathematical content (the completed proof of 💡 Cross-File Composition Issues (advisory)- The `SimSemantics/SimulateQ.lean` compatibility shell still imports `ToMathlib.Control.StateT` even though the only lemma that used `StateT.run'_map'` (`simulateQ_randomOracle_map_uniformFin`) was removed (upstreamed to VCVio). This is a stale import that could mask future dependency issues but is not a correctness problem. (`ArkLib/ToVCVio/OracleComp/SimSemantics/SimulateQ.lean:6`) _(style · low)_ _(confidence: low)_ - Evidence: The file's import line `import ToMathlib.Control.StateT` remains after the lemma `simulateQ_randomOracle_map_uniformFin` (which was its only consumer of `StateT.run'_map_comm`/`StateT.run'_map'`) was removed. - Evidence source: `lean_source` - Evidence locator: `ArkLib/ToVCVio/OracleComp/SimSemantics/SimulateQ.lean:6` - Evidence medium: `lean` - Confirmation method: `text` - Verification: independently confirmed - How to confirm: Attempt to build the file with the import removed. - Disconfirming check: Check whether any remaining definition in the file (even comments or implicit uses) requires `StateT.run'_map'` or other lemmas from `ToMathlib.Control.StateT`.Axiom/Escape Hatch Impact: None External Dependency Issues: None Missing Cross-File Verification: None 🔎 **2 finding(s) filtered by verification**Flagged by a reviewer but dropped after an independent verification pass refuted them:
Cluster: RBR soundness core: mixture bounds and implication theorems (critical)Do the master mixture bounds in 📄 **Review for `ArkLib/ToVCVio/OracleComp/RbrGame.lean`**Analysis: Analysis1. What the changed code does mathematicallyThis is a new file (
2. Mapping to spec checklist itemsThis file primarily addresses:
The implication theorems ( 3. Riskiest aspectsRisk 1: The
Conclusion: The sorried Risk 2: The convex bound's algebraic correctness. The The convex bound itself: Risk 3: The
Risk 4: The 4. Ambiguities and potential divergencesThe file is entirely ArkLib-local glue — it does not directly cite any paper result. The mixture bound is a standard probability theory result ("if per-fixed-transcript probability ≤ ε, then averaged probability ≤ ε"), which the spec checklist marks as "N/A (general probability theory)" with "No deviations — this is a standard probability bound." The convex bound is also a standard probability result. The spec checklist says the bound is 5. Faithfulness checksMixture bound (
Convex bound (
Bridge lemma (
6. Lean best practices assessment
7. Cross-file dependency checkThe key cross-file question is whether the sorried The implication theorems in
Evidence-gated assessment: Approved Checklist Verification:
Critical Misformalizations: None Lean 4 / Mathlib Issues: None Advisory feedback: None 📄 **Review for `ArkLib/OracleReduction/Security/RoundByRound.lean`**Analysis: Analysis of
|
📄 **Review for `ArkLib/Commitments/Functional/KZG/Binding.lean`**Analysis:
Evidence-gated assessment: Needs Minor Revisions Checklist Verification:
Critical Misformalizations: None Lean 4 / Mathlib Issues: None 💡 Advisory feedback
📄 **Review for `ArkLib/Commitments/Functional/KZG/FunctionBinding/Basic.lean`**Analysis: Tool verification confirms:
The lemma statement and proof structure are completely unchanged — only the lemma name in two No escape hatches, axioms, or sorrys are introduced. No hypotheses are changed. No definitions are altered. The change is safe and consistent. Evidence-gated assessment: Approved Checklist Verification:
Critical Misformalizations: None Lean 4 / Mathlib Issues: None Advisory feedback: None 📄 **Review for `ArkLib/ToVCVio/OracleComp/SimSemantics/SimulateQ.lean`**Analysis:
Evidence-gated assessment: Approved Checklist Verification:
Critical Misformalizations: None Lean 4 / Mathlib Issues: None Advisory feedback: None 📄 **Review for `ArkLib/ToVCVio/OracleComp/Coercions/SubSpec.lean`**Analysis: No checklist items from the Formalization Checklist apply to this file — it contains no security definitions, no round-by-round soundness, no mixture bounds, no extraction arguments. It is a compatibility shim. The main risk is whether any downstream code still references No escape hatches (sorry, axiom, etc.) are introduced or removed by this diff. The file is clean. No typeclass issues, no universe issues, no Prop/Type misuse. The only concern would be if some other file in the tree still references the deleted Conclusion: This is a safe, mechanical deletion with no mathematical or formalization implications. No findings to report. Evidence-gated assessment: Approved Critical Misformalizations: None Lean 4 / Mathlib Issues: None Advisory feedback: None 📄 **Review for `ArkLib/ToVCVio/ToMathlib/Control/StateT.lean`**Analysis: What the deleted lemma was: lemma StateT.run'_map_comm {m : Type → Type} {σ α β : Type}
[Monad m] [LawfulMonad m]
(f : α → β) (mx : StateT σ m α) (s : σ) :
(f <$> mx).run' s = f <$> mx.run' s := by ...What replaces it: The upstream StateT.run'_map' : ∀ {m : Type u_1 → Type u_2} {σ α β : Type u_1} [inst : Monad m] [inst_1 : LawfulMonad m] (x : StateT σ m α) (f : α → β) (s : σ), (f <$> x).run' s = f <$> x.run' sMathematical content: Both lemmas state the same thing: Checklist verification:
Signature comparison (tool-verified):
Second-order impact — consumers:
Dead code cleanup: The diff comment mentions that Risk assessment:
Faithfulness check:
Conclusion: This is a clean, mechanical deletion with the replacement lemma verified to have the same signature and semantics. No findings to report. Evidence-gated assessment: Approved Checklist Verification:
Critical Misformalizations: None Lean 4 / Mathlib Issues: None Advisory feedback: None |
I asserted in three places that this file "belongs to ArkLib core rather than
VCV-io" / "does not belong upstream at all" / "can never be upstreamed", on the
grounds that its statements mention `ProtocolSpec`. That reasoning does not hold.
The `ProtocolSpec` in these lemmas is surface, not substance. `challengeQueryImpl`
is `fun q => $ᵗ _` — answer each query with a uniform sample of its answer type —
and `QueryImpl.addLift` is already VCV-io's. No notion of protocol, transcript or
round enters any proof in the file; they are `probEvent_bind_le_of_forall_le` plus
a `simulateQ` normalisation. Generalising the challenge oracle to an arbitrary
uniform-answer `QueryImpl` would let the mixture bounds move upstream unchanged.
The two `loggingOracle` lemmas need no generalisation at all — `loggingOracle` is
VCV-io's, and `map_fst_run_simulateQ` is a strict generalisation of VCV-io's own
`fst_map_run_simulateQ`. The `$ᵗ`/`$ᵖ` bridge is blocked only by the `Pr_{…}`
notation living in ArkLib, not by any ArkLib concept.
Also records the overlap with VCVio PR #475, which adds a protocol-agnostic
round-by-round layer (`GameFamily`, `KnowledgeExtractionFamily`,
`extractionCondition_iff_isBounded`). That covers the same ground as this file and
as `OracleReduction/Security/RoundByRound.lean`, and its
`extractionCondition_iff_isBounded` may subsume the worst-case-implies-averaged
bridge proved here. Whether ArkLib should re-express its round-by-round notions on
top of #475 rather than keep a parallel formalisation is a decision best taken
before #475 lands.
Generalises the guidance in `docs/wiki/repo-map.md` accordingly: mentioning an
ArkLib type does not by itself make a lemma un-upstreamable.
Build green (4122 jobs); docs integrity green. Docstrings and docs only.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The note I added claimed VCVio #475's `extractionCondition_iff_isBounded` "may subsume" the worst-case-implies-averaged bridge proved in this branch. Checking #475's source rather than its declaration names, it does not, and two further claims in that note were loose: * #475 has **no averaged, prover-sampled notion at all** — `IsBounded` quantifies over contexts and takes the probability over the fresh challenge only. Its equivalence theorem relates two *worst-case* forms to each other, so the bridge here is complementary to #475, not redundant with it. * Its generic `KnowledgeTransitionFamily` is **law-free data** (seven fields, no axioms), whereas ArkLib's `KnowledgeStateFunction` carries three obligations. An adapter therefore packages the inner bound but transfers none of the structure. * Its source-shaped `ExtractionCondition` is **not** ArkLib's `rbrKnowledgeSoundnessOneShot`: the latter quantifies over prover and input witness, samples the prefix by running the prover, and feeds the prover's query log to the extractor, while the former fixes context and message before sampling. What does hold, and is now stated precisely: the generic `KnowledgeTransitionFamily.IsBounded` packages exactly the inner worst-case obligation of `rbrKnowledgeSoundnessWorstCase` under the evident translation. Build green (4122 jobs). Docstring only. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Note on the relationship to VCVio #475 (which adds a protocol-agnostic round-by-round layer), recorded here so reviewers of this PR know what is and isn't affected. Short version: it does not block or change this PR. What overlapsVCVio #475's generic What does not overlap
An earlier revision of Consequence for this PR: none, deliberatelyWe considered building an adapter from ArkLib's definitions onto #475's structures and decided against it. Because the transition family is law-free, an adapter would transfer the probability bound but none of our structure, and the theorems it unlocks are What we do still intend, independently of #475: upstream the generic operational content of |
`ArkLib/ToVCVio/OracleComp/RbrGame.lean` was the only file in the whole `ToVCVio`
tree importing ArkLib core, which inverts the layering: `ToVCVio` is a shim that
should sit *below* core, but that file imported
`ArkLib.OracleReduction.ProtocolSpec.Basic`. It got there because it mixed two
different things and was filed by the destination of one half.
Split accordingly:
* `ArkLib/ToVCVio/OracleComp/QueryTracking/LoggingOracle.lean` (new) — the two
`loggingOracle` lemmas, which mention nothing outside VCV-io. Path mirrors
VCV-io's own `OracleComp/QueryTracking/LoggingOracle.lean`, so upstreaming is a
straight file move.
* `ArkLib/OracleReduction/Security/RbrGame.lean` (moved) — the `ProtocolSpec`
glue: challenge-query resolution, the master mixture bound, the three `OptionT`
challenge-first bounds, the `ℝ≥0∞` identity, and the `$ᵗ`/`$ᵖ` bridge. This now
sits next to `Security/RoundByRound.lean`, its only consumer.
The `$ᵗ`/`$ᵖ` bridge is generic in content but needs ArkLib's `Pr_{…}` notation,
so it moves to core rather than staying in `ToVCVio`: depending on any ArkLib
layer, not just core, breaks the property that makes a `ToVCVio` file movable.
This establishes the invariant explicitly, in both the directory README and
`docs/wiki/repo-map.md`: **nothing under `ToVCVio` imports ArkLib outside
`ToVCVio` itself** — verified, and it now holds. It also retires the awkward
"category 2" the README had grown to justify the misfiled file.
A reviewer raised this layering point during the first review gate and it was
refuted on the grounds that no rule, linter or cycle forbade it. That was
procedurally right and design-wise wrong; recording it so the reasoning is not
repeated.
Build green (4123 jobs); docs integrity green; axiom probe unchanged across the
move — all decls {propext, Classical.choice, Quot.sound}, and
`loggingOracle.run_simulateQ_optionT_pure` still axiom-free.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Update: What changed in this PR
The This establishes an invariant, now stated in the directory README and Build green (4123 jobs), docs integrity green, axiom probe unchanged across the move. For the record: a reviewer raised this layering point during the first review gate, and it was refuted on the grounds that no rule, linter, or import cycle forbade it. That was procedurally right and design-wise wrong — worth recording so the reasoning isn't repeated. Upstreaming roadmapDecided against combining this work with VCVio #475. The two are independent, and neither shrinks the other:
Findings behind this are in the note on #475. |
First of four stacked sub-PRs splitting #505 (
feat/abf26-plan) into reviewable buckets. This onecarries the framework layer only: the
OracleReductionsecurity definitions and the ArkLib-localToVCVioglue. Rebuilt directly on currentmainrather than merged from the branch, so the diff isagainst today's tree.
Split order: PR-0 (this) → PR-1
Data/CodingTheorydefinitions → PR-2 ProximityGap/ListDecoding →PR-3
ProofSystem/ToyProblem. #505 stays open as the tracking umbrella.What's new
Worst-case-per-prefix round-by-round security (
OracleReduction/Security/RoundByRound.lean):Verifier.rbrSoundnessWorstCaseandVerifier.rbrKnowledgeSoundnessWorstCase— the paper-shapedefinitions (cf. ABF26 Def A.5), bounding the bad-transition probability at every fixed transcript
prefix, quantified before the challenge draw.
rbrSoundnessWorstCase_implies_rbrSoundnessand its knowledge analogue, discharging ArkLib's existingaveraged forms from the worst-case ones with the same error constants. ArkLib's
rbrSoundnesssamples the prefix inside the game and bounds the mixture, which is formally weaker; averaged ≤
worst-case is the safe direction.
Both bad events are reused verbatim from the existing averaged definitions, so the implications are
a genuine strengthening rather than a restatement, and the proofs preserve the error function with no
epsilon inflation.
ArkLib/ToVCVio/OracleComp/RbrGame.lean(new) — ArkLib-specificProtocolSpecglue: challenge-queryresolution, the master mixture bound the two implications rest on, the
OptionTchallenge-first masterbounds, and two
loggingOraclelemmas.Execution.lean— two prover-step theorems (Prover.processRound_of_dir_eq_V_to_P/_P_to_V),resolving the internal dependent
matchon round direction once at the framework level.A long-standing admit, closed
rbrKnowledgeSoundnessOneShot_implies_rbrKnowledgeSoundnessis now proved, together with the twosorrys inKnowledgeStateFunctionOneShot.toKnowledgeStateFunction.toFun_nextthat blocked it. Allthree predate this work. The whole one-shot cluster has no consumer outside its file, so the
supporting definitions were free to change.
It was not merely unfinished — it was unprovable as set up. A
KnowledgeStateFunction's round-0obligation is
(stmtIn, extracted) ∈ relIn, forced bytoFun_empty; buttoRoundByRound.extractMidhands back its
witInargument at that step, and that argument is universally quantified, so it maybe an arbitrary invalid witness. Two changes fix it:
Extractor.RoundByRoundOneShot.toRoundByRoundOfRel, which selects a witness valid forrelInwhenever one exists (classically —
extractMidis a function, not an algorithm). It needsrelIn,so it cannot live in the relation-agnostic
toRoundByRound, which is left untouched;∃ v, (stmtIn, v) ∈ relInas its disjunct at nonzero rounds,replacing one about the extractor's output at that round — unusable, since nothing relates the
extractor at round
m+1to the extractor at roundm.Together these force the general bad event to imply that
relInholds no witness forstmtIn.That is the bridge to the one-shot event, whose extra conjunct says the extractor fails on the
prover's query log: the general event cannot mention a log at all, since
extractMidnever receivesone, but with no witness in existence that conjunct holds for free whatever the log. The comparison is
then pointwise — both notions score a syntactically identical game.
Upstreaming cleanup
Most of the branch's
ToVCViowork is already in VCVio. It was written against VCVio5f7707fb(v4.30);
mainpinscbd4144b(v4.31, VCVio #477), which absorbed it — several of the local copiescarried "upstream VCV-io candidate" docstrings and were duly upstreamed. Confirmed by the compiler
(
… has already been declared), not by name matching:SimulateQ.lean— all 30 declarations already upstream; now a compatibility shell. 29 of themproduced
already declarederrors outright. The 30th,simulateQ_randomOracle_map_uniformFin, is an exact duplicate too — identical statement andproof, down to already using
StateT.run'_map'— but it never clashed, because both copies sit atroot scope in different modules: this file imported
RandomOracle/Basic, neverRandomOracle/Simulation. Importing the latter lets the sole consumer(
KZG/Sampling.lean:56) resolve upstream. A duplicate that is merely out of scope is still aduplicate.
RbrGame.lean— 3probEvent_bind_le_*lemmas dropped; the ~10ProtocolSpec/loggingOraclegluelemmas are genuinely ArkLib-specific and stay.
SubSpec.lean— both remaining lemmas upstream; now a compatibility shell, matching the conventionalready used for
EvalDist/Defs/Support.leanand friends.bind_liftComp_mapdeleted with them: nocall site anywhere in the tree, and it duplicates Mathlib's
bind_map_left.ToVCVio/ToMathlib/Control/StateT.leandeleted;SimulateQand the two KZG call sites use VCVio'sStateT.run'_map'.That is why this PR is 723/94 rather than the ~1214 lines the split plan projected: roughly 550 lines
would have been re-duplicated.
To be precise about what that cleanup is worth, since it is easy to overstate: those ~550 lines are
code not added, not code removed — they only ever existed on
feat/abf26-plan. Measured againstmain, this PR removes exactly three lemmas (~53 lines). Two of those are real wins:simulateQ_randomOracle_map_uniformFinwas defined at root scope under an identical name in bothArkLib and VCVio and survived only because no module imported both — a latent ambiguity, now defused —
and
bind_liftComp_mapwas unreferenced and duplicated Mathlib. The third is a rename.Declarations that land ahead of their consumers
By design of the split, most of
RbrGame.leanhas no in-tree consumer yet — only the master mixturebound is used today (by the two implications). The
OptionTbounds, theloggingOraclelemmas, and the$ᵗ↔$ᵖbridge are consumed byProofSystem/ToyProblem/**, arriving in PR-3. This is stated in themodule docstring's staging note so a reviewer of this PR alone isn't left guessing.
Each staged declaration was checked to have a live tactic call site on
feat/abf26-plan, not merelya docstring mention. Two failed that check and were deleted rather than staged:
…_getChallenge_first_bind_le_add(superseded by its_convexsharpening, which is what the branchactually calls) and
Prover.runToRound_succ(no consumer on any ref).One honest caveat on the headline pair: only the knowledge half
(
rbrKnowledgeSoundnessWorstCase+ its implication) has a consumer on the parent branch, atToyProblem/Spec/General.leanandSpec/ErasureDecoder.lean. The plain-soundness half is kept as thedefinitional companion — it is the same paper definition specialised to soundness, and splitting the
pair would be worse than carrying it — but it is, today, unused.
Verification
lake build— green, 4122 jobs, 0 errors.#print axiomson every new and changed declaration —{propext, Classical.choice, Quot.sound},zero
sorryAx. TwoExecution.leantheorems don't even needClassical.choice.sorrys removed, none added.RoundByRound.leanis now sorry-free (seeabove). The one remaining in this PR's files is
Reduction.runWithLog_discard_logs_eq_run(
Execution.lean), unchanged frommainand now documented as propagatingsorryAxthroughsimp— whichmaindisclosed nowhere.scripts/validate.sh --lint --docshas one failure,Paper page without matching BibTeX key: docs/kb/papers/NOZ26.md— pre-existing onmainand untouched here (this PR changes neitherdocs/kb/papers/norreferences.bib, so the check's inputs are identical tomain's).Documentation
docs/kb/audits/open-problems-list-decoding-and-correlated-agreement.mdrecorded ABF26 Definition A.5as
present-but-different, on the grounds that ArkLib had only the averaged forms. This PR makes thatfalse, so the row is promoted to
presentcitingrbrKnowledgeSoundnessWorstCase.docs/wiki/repo-map.md's description ofArkLib/ToVCVio/("helper lemmas before they are upstreamed")no longer covers a directory containing never-upstreamable glue and five compatibility shells, and is
extended accordingly.
docs/kb/_generated/**is deliberately untouched — CI blocks committing it fromfeature PRs. No
\lean{}reference inblueprint/src/points at any declaration removed here.Review
Two adversarial multi-agent review rounds were run over this diff before opening — 51 findings raised
in total, 17 confirmed, the rest refuted by independent verifiers. Every confirmed finding was
documentation accuracy or API hygiene; none touched a statement, a proof, or axiom hygiene. Acting on
them, two declarations were deleted rather than shipped, each verified to have no tactic call site
anywhere including the source branch:
…_getChallenge_first_bind_le_add(its_convexsharpening iswhat the eventual consumer actually calls) and
Prover.runToRound_succ.Non-vacuity was established constructively rather than argued: concrete protocols inhabiting both new
definitions were compiled at error
1/N(instantiated atN = 2^128), the per-prefix game probabilitywas shown to be exactly
N⁻¹, error0was proved impossible for that instance, and the twoimplications were applied to those inhabitants to produce the averaged notions with the same constant.
🤖 Generated with Claude Code