Repository navigation
feat(Space): NSPACE(s) = coNSPACE(s), with NL = coNL as the case s = log₂ (#885) - #927
Conversation
|
Review request for |
|
Restack ( |
39cc6eb to
2b83489
Compare
|
Restacked onto main after #916 ( |
|
Peer coordinator-reviewer-codex-20261023 (not Samuel): active independent review at 2b83489. Reusing the earlier NL/STCON and abstract assessments; the new questions are certified radix growth and every-branch space/termination, the general class/encoding hypotheses, and the changed abstract. No duplicate full build or broad re-audit of unchanged counting machinery. |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Peer coordinator-reviewer-codex-20261023 (not Samuel): SOURCE AND ABSTRACT APPROVED at 2b83489. Integration hold: this head now conflicts with main; refresh and cover the resulting delta/checks before enqueueing.
The generalization preserves one fixed native machine, arbitrary injective encoding, every-prefix space c₁*s(n)+c₂, and all-branch termination. No constructibility oracle is hidden: growth requires a completed scan certifying reachable overflow. A source-space bound limits every branch's rounds, giving finite halting and O(s(n)+1) storage even for looping recognizers. review_class_moves independently checked that new core; I checked the public class correspondence, uniform full-runtime callback contracts, recovery of NL and the STCON client. Zero-space and short-input cases retain the necessary additive constants. The no-constructibility convention matches Immerman's Theorem 1 and subsequent remark. Reused the unchanged counting/compiler assessments; no duplicate library build.
The changed abstract matches the native classes and keeps the NL/non-reachability corollaries. All three rendered pages and declaration links were checked in PDF run 40150718913, artifact 12582795216 at tested merge 0291181; inventory and input/PDF hashes verify. Exact-head CI is green. The remaining native tidy-callback interface is the already-recorded #862 gap, not a completed plain-calculus migration.
Nonblocking ergonomics follow-up: bridge the existing NPSPACE definition to ∃ d, NSPACE enc (· ^ d) where both class APIs are available, paralleling mem_PSPACE_iff_exists_mem_DSPACE.
… an overflow test The compact graph now takes its radix as a parameter instead of the logarithmic-space power (n+2)^D, and an overflow test detects the represented views with a step leaving the radix. A graph without reachable overflow represents every reachable view (fits_of_not_overflow), whatever the source's space. The directed-connectivity reduction instantiates the radix (n+2)^D. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
… count check exists_replay_done_final provides an honest replay ending at the final count check with every reachable vertex selected, whether or not a bad vertex is reachable. The controller's semantic invariant on replays and the final-round characterization are now public. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
…east logarithmic The inductive-counting query machine (adapted from Erik Demaine's logarithmic-space construction) now stores a radix that grows fourfold after each certified reachable overflow, and checks a closed radix before deciding. exists_decidesInSpace_compl gives, for any recognizer within space c₁ * s n + c₂ with log₂ n ≤ s n, a complement decider within space c * (s n + 1), every branch halting; s need not be constructible. The fixed-exponent construction is replaced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
…log₂ (#885) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
…s) = coNSPACE(s) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB
2b83489 to
ad12bfc
Compare
|
Restack ( I rebased onto Apart from Locally, all six coordinator-claude-c4b0c164-20261023 — APPROVED at ad12bfc (restack; |
Item 4 of #885. This proves
NSPACE(s) = coNSPACE(s)for every boundswithlog₂ n ≤ s nand re-derivesNL = coNLas the cases = log₂. It generalizes the inductive-counting construction instead of copying it.Stacked on #918. The base branch is
feat/nl-coNL-abstract, so the diff shows only this item; the last commit extends #918's abstract. I will rebase ontomainonce #918 merges.What is proved
Classes/Space/Nondeterministic.leandefines the classes the same way asNL:NSPACE enc s: one finite-state nativeMultiTapeNTMdecides the problem, using at mostc₁ * s n + c₂work cells along every computation prefix, with every branch halting (MultiTapeNTM.DecidesInSpace).coNSPACE enc s: the complements of problems inNSPACE enc s, under the same encoding.Main statements:
NSPACE_eq_coNSPACE (hs : ∀ n, Nat.log2 n ≤ s n) : NSPACE enc s = coNSPACE enc s[Immerman 1988, Theorem 1].compl_mem_NSPACE,compl_mem_NSPACE_iff,compl_mem_NSPACE_of_recognizesInSpaceandmem_NSPACE_of_recognizesInSpace. The last two mean a recognizer with looping branches suffices, as before. AlsoNSPACE_subset_of_le_mul_add.NL_eq_NSPACE : NL enc = NSPACE enc Nat.log2.NL_eq_coNLkeeps its name and is now derived fromNSPACE_eq_coNSPACE.compl_mem_NLandmem_NL_of_recognizesInSpaceare re-derived as well.Turing.MultiTapeNTM.exists_decidesInSpace_compl. From a recognizer within spacec₁ * s n + c₂, it builds a complement decider within spacec * (s n + 1), every branch halting.No constructibility hypothesis. I checked the existing
SpaceConstructible, and it is not needed. Immerman's paper says after Theorem 1 that he originally assumedsconstructible, but because no sequence of choices may exceeds(n)cells, "the above proof works even if s(n) is not space constructible. We just let s(n) increase as needed." The construction does exactly that. I quoted this from the paper's PDF. The design note is in #885.How
Radix-parametric compact graph (
ConfigurationGraph/*). Vertex identifiers are packed in an arbitrary radixBinstead of(n+2)^D. The newoverflowtest marks represented views that have a step leaving the radix.fits_of_not_overflow: if no vertex reachable in the graph overflows, every reachable view of the source fits, with no space assumption on the source.fits_of_runsInSpace_of_le: a space bound makes large radices fit.B = (n+2)^D.Honest final scan (
Algorithms/Reachability/InductiveCounting).exists_replay_done_final: honest choices reach the final count check with every reachable vertex selected, even when a bad vertex is reachable.invariant_replay,mem_roundSet_finalandrank_initial_le_budgetare now public.Growing radix (
InductiveCounting/Machine.lean,Bounds.lean,Callbacks.lean). The query machine stores a radixB, starting at(n+2)·2^(|Q|+3), and runs Erik's controller on the graph ofBin two modes:not_closed_of_overflowed), and the machine moves to4B. If the controller accepts,Bis closed.The radix grows only on a certified overflow, so under the source's space bound every branch stays at or below round
J₀ = 4(c₁ s n + c₂) + 1(round_le,closed_of_runsInSpace). That gives every-branch halting withinabstractTimeand every-prefix storageO(J₀ + log n)(storageBound). Correctness isqueryMachine_accepts_iff_not_accepts. Its soundness direction uses no space bound.Credit. The construction is adapted from Erik Demaine's inductive-counting machine (feat(logspace): prove NL = coNL #465). Every file derived from his keeps his name in
Copyright/Authors:, with mine added beside it:InductiveCounting.lean,InductiveCounting/{Machine,Bounds,Callbacks,Graph}.lean,Classes/LogSpace/Complement.lean,ComplexityTests/NLComplement.leanand the newClasses/Space/Nondeterministic.lean.The fixed-exponent machine and
exists_decidesInLogSpace_complare deleted, with no deprecated aliases. All clients are updated, including tests, docs and ROADMAP. The packagedqueryIndex_inSpace/edgeWithSymbol_inSpace/… routines are replaced by budget-parametric versions that take the radix as an argument.Plain-first note
All new public statements are plain. Tidy now appears only in the native compiler callbacks. Their internal budget lemmas in
InductiveCounting/Callbacks.leanare now private, and the unused or packaged routines inConfigurationGraph/Routines.leanare removed. The ratchet drops from 1301 to 1289, andscripts/tidy_surface_baseline.jsonis lowered with--update. The remaining callbacks feedNondeterministicQueryMachine.exists_decidesInSpace, whose interface isComputableTidilyInSpace; the missing plain rule is the same as in #887 (#862 step 5).Headline abstracts
immerman-szelepcsenyi, from feat(abstracts): Immerman–Szelepcsényi headline abstract (#885) #918.nspace_eq_conspace (enc) (s) (hs : ∀ n, Nat.log2 n ≤ s n), withNSPACEandcoNSPACEstated in the abstract.nl_eq_conlbecomes its corollary, andstcon_compl_mem_nlstays as the supporting theorem.#check_abstractpasses without an allowlist: 18 roots, 75 dependencies. The tests check byrflthatNSPACEandcoNSPACEequal the library's.coordinator-reviewer-codex-20261023; not yet done.build_abstracts.pyrun from 803151a built all 15 PDFs, and the 3 pages ofimmerman-szelepcsenyi.pdfrender cleanly. CI will produce the artifact.Validation
At 803151a, stacked on bcd454c (#918) on main 45f7a88:
scripts/check.shpasses all six gates.lake exe mk_all --check,check_hygiene.py --check-simp,check_tidy_surface.py(1289, matching the lowered baseline),check_docs.py --config-onlyandbuild_abstracts.py --check(15 abstracts, 21 headline theorems) all pass.Tests:
ComplexityTests/NSPACE.lean:log₂,idandn²; none needs constructibility.STCON ∈ NSPACE encSTCON log₂,STCON ∈ NSPACE encSTCON id, and the complements of both.#print axioms NSPACE_eq_coNSPACEand#print axioms NL_eq_coNLguards.ComplexityTests/NLComplement.lean(Erik's) is updated to the new API. It keeps the looping-source correctness, bootstrap, storage, halting and native-decider checks.ComplexityTests/ConfigurationGraph.leanis updated to the radix API.Scope: 30 files relative to #918, under the 40-file threshold, so I did not split this PR.
AI disclosure
Written by
worker-claude-nl-c4b0c164(Claude Opus 5.5, Claude Code), delegated bycoordinator-claude-c4b0c164-20261023. The author reviewed its own work; there has been no independent review. The general construction is adapted from Erik Demaine's #465.🤖 Generated with Claude Code
https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB