Repository navigation
feat(Languages/Probabilistic): typed views of word oracles (OracleCodec); LR pilot - #5071
SamuelSchlesinger wants to merge 3 commits into
Conversation
…ec); LR pilot Add `OracleCodec Op Q spec`: typed queries carried on named word requests, with a canonical decoder and injective reply encodings. `adapt` runs a word program against a typed oracle (malformed requests answered `[]` without a call), `wordOracle` is the word oracle a typed oracle presents, and `interpret_adapt`/`run_adapt`/`runWith_adapt` identify the two runs. `isCostBounded_adapt`/`isQueryBounded_adapt` transfer budgets. Standard codecs: `id`, `bitString`, `comap`, `withOp`. Pilot: Luby-Rackoff's hand-written `pairAdversary` and `strongPairAdversary` (with their query-bound and interpretation lemmas) are replaced by `(pairCodec n).adapt` and `(strongPairCodec n).adapt`. Milestone I3a of #4894; the typed PPT predicate (`IsOraclePPTOf`) and efficient-codec conditions remain (I3b).
|
Agent review claim: coordinator |
|
Review (Jetski revc-2, session 7eb004ef-055e-4c26-8b2e-bee0bc58f5fc) at 1f52f10: APPROVE. Agent review, not human approval. Mathematical progress: none, by design. This is infrastructure: a reusable typed/word oracle adapter, plus a client migration. The API is right. The Representative caller: Luby–Rackoff no longer hand-writes the decoding handler, its Deferral: Optional, not blocking (don't push just for these; per #1077, fold them into the main-merge push after #5022):
Validation at this head:
Manuals: the new probabilistic-workflows section matches the API and links to a checked client. The Agent Operator's Manual needs no edit. I'll add the rendered record once manual run 43388407169 finishes. This is held until #5022 lands and main is merged in, as the body says; I'll review that merge and queue it then. |
|
Rendered-manual check for the approved head 1f52f10. Rendered: inspected PDF pp. 59–60 (printed 51–52) of cslib-frontier-operators-manual.pdf from run 43388407169, plus the p. 3 table of contents: OK. The new §6.33 "Run a word adversary against a typed oracle" starts on p. 59 and ends on p. 60, just before §6.34. I checked the text layer, link annotations and word bounding boxes: no raw markdown, every word stays inside the 72pt margins, and the Codec, LubyRackoff and OracleCodec-test links point to this head. The Agent review (Jetski revc-2, session 7eb004ef-055e-4c26-8b2e-bee0bc58f5fc), not human approval. |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Coordinator review (coordinator agy-634bba4c, session 634bba4c-9d3c-4f80-8d5b-6097f495b913) at head 1f52f10915fadf3eba5a2d2f598dcba943ba7973: APPROVE (concurring with revc-2, held behind #5022). This is agent review, not human review.
- API & client migration:
OracleCodec Op Q spec(CslibFrontier/Languages/Probabilistic/Oracle/Codec.lean) sits cleanly at the machine-independentLanguages/Probabilistic/Oraclelayer, capturing canonical query encoding/decoding (decodeQuery_eq_some_iff) and reply encoding without duplicating simulation infrastructure:adaptunfolds toProbOracleComp.simulateagainstc.wordOracle, givinginterpret_adapt,run_adapt,runWith_adapt,isQueryBounded_adapt, andisCostBounded_adaptdirectly from existing laws.LubyRackoff.leanreplaces bespoke word-decoding handlers and budget inductions withpairCodec_wordOracleandstrongPairCodec_wordOracle(withOpoverpairCodec), keeping all public theorem statements unchanged. Local hygiene, projection-chain, changed-files, and manual checks all pass (0errors). - Visual rendered-PDF verification (
Operator's Manual PDFsrun43388407169,source_revision = 1f52f10915fadf3eba5a2d2f598dcba943ba7973): visually inspected rendered PNGs ofcslib-frontier-operators-manual.pdfpp. 59–60 (printed pp. 51–52, §6.33 "Run a word adversary against a typed oracle") by eye—clean typography, line wrapping, links, and margins, with no raw Markdown or missing glyphs. - Sequencing hold & optional rebase nits:
git merge-treeconfirms the expected conflict with queued#5022inCslibFrontier/Crypto/Computational/LubyRackoff.lean, so do not enqueue#5071until#5022lands onmainand#5071mergesmain. When updating after#5022lands, two optional non-blocking cleanups if convenient:CslibFrontierTests/OracleCodec.lean:28uses non-terminalsimp [...]beforesimp [OracleComp.runWith, ...];simp only [...](or a single terminalsimp) keeps test simp hygiene tight.OracleCodec.withOpcan generalize{R : Type} (c : OracleCodec Unit Q fun _ => R)to dependent{spec : Q → Type} (c : OracleCodec Unit Q spec) : OracleCodec Op (Op × Q) (fun p => spec p.2)with identical proof terms.
|
Dependency cleared ( |
…typed # Conflicts: # CslibFrontier/Crypto/Computational/LubyRackoff.lean
|
Agent review (Jetski coordinator jetski-coord-8077, session 80777270-7fc8-4ed2-8b5e-505438916d3f), head 57caa85: APPROVE the delta since the approved 1f52f10. This is agent review, not human review.
|
|
Delta review by revc-2 (agent review, not human approval): main merge 1f52f10→57caa85e7 (main 956da62, after #5022) plus 13e1d32 is APPROVED.
I'll queue on green ci-checks/guide. Please don't push. |
Change
Milestone I3a of #4894, which stays open for I3b.
OracleCodec Op Q specrecords how typed queriesq : Qwith repliesspec qtravel on named word requestsOp × List Bool. The new moduleLanguages/Probabilistic/Oracle/Codec.lean(upstream: candidate) provides:adaptruns a word program against a typed oracle. Requests that carry no query get[]without a call.wordOracleis the word oracle that a typed oracle presents.interpret_adapt,run_adaptandrunWith_adapt: the typed run ofc.adapt Pis the word run ofPagainstc.wordOracle, for any lawful monad, including theStateT State PMFrunner.isCostBounded_adaptandisQueryBounded_adapttransfer budgets.id(withadapt_id),bitString n,comap(transport along a query equivalence) andwithOp(one copy per channel).Representative caller: Luby–Rackoff. It deletes
pairAdversaryandstrongPairAdversary, together with their hand-writtenisQueryBounded_*/interpret_*lemmas. Their uses become(pairCodec n).adaptand(strongPairCodec n).adapt.pairCodecisbitString (2n)transported alongblockEquiv, andstrongPairCodeciswithOp Bool pairCodec. The proofs now useinterpret_adaptplus onewordOracleidentification instead of re-proving query bounds and interpretation by induction (+51/−82 in LR).Deviations from #4894's scope (recorded in issuecomment-6847248250):
rejectfield. Every existing adapter answers malformed requests[].decodeQuery r = some q ↔ encodeQuery q = r.Languages, because the codec needs no machine model.IsOraclePPTOf, the efficient-codec conditions, typed.query/.simulateand saved-coins replay remain for I3b. They will land with the first client that states a typed PPT hypothesis.sym's word adapters (
randomFunctionQuery, the Even–Mansour adapter) can migrate after #5022. This PR conflicts with #5022 in LR, and I'll merge main after #5022 lands.Authors of new files: Samuel Schlesinger (issue author, and the person whose agents did the work).
Manual impact
manual/workflows/probabilistic-workflows.md, "Run a word adversary against a typed oracle". It covers when a word game equals the typed game of the adapted adversary, the run and budget lemmas, the codecs, and the LR client. Its checked example isCslibFrontierTests/OracleCodec.lean(a stateful counter oracle, a malformed request, and a budget transfer).Validation
lake build --wfail --iofailof Codec, LubyRackoff,CslibFrontierTests.OracleCodecandCslibFrontierTests.Crypto.ComputationalLubyRackoff: passed.lake lintof both library modules: passed.mk_all --check,check_hygiene.py --check-simp,check_changed_files.py, the encoding-readability and projection-chain ratchets andcheck_operator_manual.py: passed.AI assistance
Written by a Jetski (Gemini) agent (worker
infra, session de72c51e) under Samuel Schlesinger's direction. The review here is agent review.