Repository navigation
refactor(Complexity/Space): state PSPACE through ComputableInPolySpace, like P and L - #4802
Conversation
…e, like P and L
PSPACE enc is now {A | ∃ f, ComputableInPolySpace f enc encBool ∧ ∀ a, a ∈ A ↔ f a = true},
with mem_PSPACE as Iff.rfl. mem_PSPACE_iff_computableInPolySpace and
mem_PSPACE_of_computableInPolySpace duplicated that unfolding and are removed; their callers use
anonymous constructors, as P's do. mem_PSPACE_of_computableInTimeAndSpace packages the
time/space-bound constructor that Savitch, TQBF membership and mem_PSPACE_iff share.
Part of #4737
|
Agent review (Jetski reviewer session aa3000d8-52c2-410f-8f18-9f617338b54e) of 7eddd80: approve. This is agent review, not human review. The refactor holds up.
API:
Each of these reads better. The anonymous-constructor clients match how Imports: the public Non-blocking follow-up: Manuals: I agree no edit is needed. Open PRs:
Other reviews: none on this PR at the time of review, so there are no open findings. CI at this head: ci-checks and guide pass. Advisory notices:
|
Change
PSPACEnow has the same shape asPandL:mem_PSPACEisIff.rfl, likemem_P. Before,PSPACEspelled out the time/space pair∃ t s, PolyBounded … s ∧ ComputableInTimeAndSpace f enc encBool t s, while the closure proofs went through a separate bridge toComputableInPolySpace. That bridge now holds by definition, so the two wrappers around it are deleted:mem_PSPACE_iff_computableInPolySpace, an exact duplicate ofmem_PSPACE;mem_PSPACE_of_computableInPolySpace, its.mpr.Their callers in nine files now build or destructure membership directly with
⟨f, hf, hA⟩, as callers ofPdo: the closure lemmas inSpace/Closure, plusCounting/Space,IP/PSPACE,Space/TM2,SAT/Space,TM2/Reverse/Transferand three tests.mem_PSPACE_iff, the bridge to upstreamDecidableInTimeAndSpace, is unchanged in statement.Three proofs built membership from an explicit time/space bound: Savitch's
mem_PSPACE_of_recognizesInSpace,TQBF_mem_PSPACEandmem_PSPACE_iff. They now share one constructor,mem_PSPACE_of_computableInTimeAndSpace, which goes throughComputableInPolySpace.of_inSpace.P_subset_PSPACEbecomes⟨f, .of_polyTime hf, hA⟩.L_subset_PSPACEbecomesL_subset_P.trans P_subset_PSPACE, the only edit toLogSpace.leanand clear of #4800's hunks. TheComputableInOcharacterization inSpace/Closurenow usesof_inSpaceinstead of rebuilding the polynomial bound.This is refactoring only, with no new mathematics. The definition is equivalent to the old one: a Boolean output has length one, so
ComputableInPolySpace's output charge is free. Net −14 lines (+71/−85).Imports:
Space.leangainspublic import …MultiTape.ResourceBoundsfor the definition. That module was already in its transitive closure, so no new fan-out. It also gains a privateimport …Complexity.PolySpace.Plainforof_polyTime/of_inSpace. This adds four small modules toSpace's build closure (PolySpace,PolySpace.Plain,BigO.Plain,InSpace.Plain).Space/Closure,Oracle/Spaceand most otherPSPACEclients already import them.Manual impact
Operator's Manual: no edit.
manual/machines-and-classes/native-and-resources.mdlistsPSPACEamong the classes that "derive familiar bound families" and describesComputableInPolySpacein its resource table. Both are still accurate, and no chapter names the removed lemmas (git grep). Agent Operator's Manual: no edit, since no workflow or tooling changed.ROADMAP.md,results/README.md,CslibFrontierResults/andTM2/README.mddo not name the removed declarations or describePSPACE's body.Validation
At 7eddd80 (based on main 936b94e;
git merge-treewith main d3c8831 is clean, and main has not touched these files since the base):lake build --wfail --iofailon every library, test and results module that mentionsPSPACE(85 modules, including all changed files and the destructuring clients Savitch, TQBF, EXPSPACE, Oracle/Space, Inclusions, Alternation and TM2/Reverse/Transfer).lake exe mk_all --check,python3 -B scripts/check_operator_manual.py,check_hygiene.py --check-simp, and both ratchets (check_encoding_readability.py,check_projection_chains.py).python3 scripts/proof_copies.py --base origin/main: no repeated proof block.python3 scripts/parallel_defs.py --theorems --no-build-check: no duplicate among the 19 theorems. Coverage is partial because 11 unrelated library modules had no local build outputs.Full validation is left to CI.
AI assistance
Jetski worker session
c0af227b, plan #4737. Agent-written; not yet reviewed by a human.Part of #4737