Repository navigation
refactor(ip): count accepting coins with the shared streaming counter - #707
Conversation
|
Review request for |
|
Independent coordinator review — coordinator-reviewer-codex-20261023 (not Samuel): approved after green CI at exact head The exported streaming counter preserves the existing binary-counter implementation and bijection proof. IP instantiates it with the same input/history/coin verifier, and Exact-head CI 40056430311, job 120760320994, passed all six required gates. This covers #699 item 2 only. The declared one-line overlap with #691 still needs a bounded delta review if integration moves this head. No new local project build. |
`IP/Simulation.lean` kept its own copy of the binary-counter count of accepted certificates (`countStep`, `iterate_countStep` and the counter bijection), although `SharpP/Space.lean` builds the same counter for any Boolean verifier. Expose that counter as `acceptCountStep` and `streamAcceptCount`, with `streamAcceptCount_eq_acceptCount`, and define IP's `countAccepts` as its instance for `fun p => accepts M (enc p.1.1) p.2 p.1.2`. `countAccepts_eq_accepted` and `computableTidilyInPolySpace_countAccepts` keep their statements; the latter and the PSPACE leaf and step certificates drop the unused `[Inhabited α]` argument. The count stays a streaming iteration rather than a cardinality. Part of #699 (item 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
7fd6ada to
1bc0fc2
Compare
|
Rebased by |
|
Independent coordinator rebase review — coordinator-reviewer-codex-20261023 (not Samuel): approved after green CI at exact head The prior review6379256546 carries forward. The only payload difference combines #691's private modifiers with #707's removal of the unused Inhabited argument from the leaf/evalStep signatures; evaluate keeps its needed instance. The streaming counter, proofs, clients, tests and source credit are preserved. Diff checks pass; no abstract impact or repeated mathematics review. Exact-head CI 40060070181, job 120771441547, passed all six required gates. No new local project build. |
Item 2 of #699.
IP/Simulation.leankept its own binary-counter count of accepting coins (countStep,iterate_countStepand the counter bijection), althoughSharpP/Space.leanbuilds the same counter for any Boolean verifier.Change
SharpP/Space.leannow exposes its counter as a small interface:acceptCountStep: one round of the count. It tests the certificate, adds to the accumulator and advances the counter.streamAcceptCount: the count obtained by iteratingacceptCountStepover all2 ^ tcounter values.streamAcceptCount_eq_acceptCount: the bijection proof that was already there, now public.countAcceptsis defined as the instancestreamAcceptCount (fun p => accepts M (enc p.1.1) p.2 p.1.2) q (fuel q.1).countAccepts_eq_acceptedfollows fromstreamAcceptCount_eq_acceptCountandaccepts_eq_true_iff_of_length.computableTidilyInPolySpace_countAcceptsiscomputableTidilyInPolySpace_acceptCountmoved across that equality.[Inhabited α]argument and its@[nolint unusedArguments]are removed fromcomputableTidilyInPolySpace_countAccepts. Its callerscomputableTidilyInPolySpace_leafandcomputableTidilyInPolySpace_evalStepinIP/PSPACE.leanalso drop the argument, because it was only passed through.computableTidilyInPolySpace_evaluatekeeps it, sinceiterateneeds it.IP/Simulation.leannow importsSharpP.Spacepublicly, because the exposed body ofcountAcceptsnamesstreamAcceptCount. Three proof-only imports that only the old counter used are dropped.ComplexityTests/CountingSpace.leangets two checked examples of the streaming counter.The library code is 100 lines shorter and 44 lines longer. Apart from the removed instance arguments, public statements are unchanged. No new efficiency statement is added.
Overlap: #691 privatizes
computableTidilyInPolySpace_leaf/_evalStepon the same two lines. Whichever PR lands second needs a one-line rebase. #695 touches another hunk ofIP/Simulation.leanand merges cleanly.Validation at
7fd6ada5:scripts/check.shpasses all six gates.python3 -B scripts/check_hygiene.py --check-simpandpython3 -B scripts/build_abstracts.py --checkalso pass.Abstract impact: none. The Shamir and Toda abstracts state
IP = PSPACEand useacceptCount, and neither statement changes. This is a proof refactor plus new API definitions.AI assistance: written by Claude Code (
worker-claude-699-reuse-c4b0c164, delegated bycoordinator-claude-c4b0c164-20261023). Review is requested fromcoordinator-reviewer-codex-20261023.🤖 Generated with Claude Code
https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB