Repository navigation
feat(Languages/Probabilistic/Oracle): stateful and logging oracle runs - #4978
SamuelSchlesinger wants to merge 6 commits into
Conversation
….run Add `ProbOracleComp.run` (Languages/Probabilistic/Oracle/Run.lean), which runs an oracle program with fresh uniform coins and an oracle `O`, with simp lemmas, `run_simulate` and `eval_run`. The finite PRF games become `PRF.realExperiment`/`PRF.idealExperiment : ProbComp Bool`. The new `Primitives/PRP/Finite.lean` adds the finite PRP experiments, the PRP/PRF switching lemma (Boneh-Shoup Theorem 4.4), Corollary 4.5 and the strong-PRP-to-PRP lift `StrongAdversary.ofForward`. The word-level switching lemma, CTR, OFB, RandomFunctionHybrid and the garbling clients are migrated, with no aliases. The seven CTR/OFB/RFH theorem names that cited the removed games now name the experiments. Part of #4817.
…yBounded.simulate Address revc-1's review of #4850: - the Privacy/FreeXOR/HalfGates/BinaryToOneHot reduction helpers are stated on `(reduction …).run fun q => pure (f q)` (`eval_run_reduction`, `run_tableRun`), so the PRF-experiment clients no longer unfold `ProbOracleComp.run`; - new `Oracle/Substitution/QueryCount.lean` with `isCostBounded_simulate` and `IsQueryBounded.simulate`, used by `isQueryBounded_ofForward` and `isQueryBounded_toFinite`.
runState answers external queries with StateT programs; runLog and runLogWith return the chronological log of answered queries (runLogWith's oracle reads the log and may refuse). IsQueryBounded.length_runLog(With)_le bound the log by the query budget, derived from OracleComp.IsCostBounded.measure_le via measure_runState_le. Part of #4893 (I2a).
…-run #4850 landed squashed; take main's version of its files, keeping only I2a's own changes (Oracle/RunState, its test, the aggregate line and the programs-and-realization paragraph).
|
Agent review (Jetski revc-2 session 7eb004ef-055e-4c26-8b2e-bee0bc58f5fc), head 0f06d7e: APPROVE.
Optional, not blocking: the Checked locally at this head: This is an agent review, not human approval. |
|
Rendered-manual check for the approved head 0f06d7e. Rendered: inspected PDF p. 414 (printed p. 406) of cslib-frontier-operators-manual.pdf from run 43369525874: OK. This is the new I checked the page's text layer, link annotations and word bounding boxes: no raw markdown, every word stays inside the 72pt margins, and the new links point to this head. Agent review (Jetski revc-2, session 7eb004ef-055e-4c26-8b2e-bee0bc58f5fc), not human approval. Agent Operator's Manual: no edit needed. Its manifest takes only |
Part of #4893 (I2a). Builds on
ProbOracleComp.runfrom #4850.This PR adds
Languages/Probabilistic/Oracle/RunState.lean, which runs an oracle program against a challenger oracle that keeps state or a log. It is meant to replace the inline sum handlers and the per-lane runners.A.runState O: each queryqruns aStateT σ ProbCompprogramO q, and private draws stay uniform. The simp laws arerunState_pure/bind/map/query/sample.eval_runStategives its law asrunWith, andrunState_liftsays that a memoryless oracle reduces torunwith the state unchanged.A.runLog OandA.runLogWith Oreturn the result together with the chronological log of answered queries. InrunLogWith, the oracle can read the log and refuse a query:O log q = noneanswersdefaultand logs nothing. This is the form of one-time and no-repeat signing and MAC oracles.logOracle_runis the one-call equation that sig asked for.IsQueryBounded.length_runLog_leandlength_runLogWith_lebound the log length by the query budget. They come frommeasure_runState_le, the stateful form ofOracleComp.IsCostBounded.measure_le, so the counting argument is made once.This is infrastructure, not new mathematics. Limitations: there is no library client in this PR. I2b (stacked, opens next) puts UntilBad's
runStatelessOracle/runFinderOracleonrunStateand adds theIsOraclePPTcertificate. The encrunAgainst, mac and sig runners move when their lanes type their oracles (#4817 infra row). The checked examples are inCslibFrontierTests/OracleRunState.lean.Manuals. In the Operator's Manual,
programs-and-realization.mdgets a paragraph after therunparagraph coveringrunState,runLog,runLogWithand the log bound. The Agent Operator's Manual needs no change, since agent workflow, tooling and validation are unaffected. ROADMAP and the results inventory are unaffected. The new module carries-- upstream: candidate.Validation. At this head (main merged; #4850's files taken from main):
lake build --wfail --iofailof the module and its testlake linton the modulecheck_hygiene.py --check-simp,mk_all --check,check_operator_manual.py@[expose]/new-test checksThe full run is on CI.
AI disclosure: written by the Jetski agent
infra(conversation de72c51e) for Samuel Schlesinger; agent self-reviewed, awaiting independent review.