Skip to content

feat(complexity): put NL in logspace-uniform AC¹ and NC² - #8908

Open
SamuelSchlesinger wants to merge 21 commits into
mainfrom
feat/containments-nl-uniform-codex
Open

SamuelSchlesinger wants to merge 21 commits into
mainfrom
feat/containments-nl-uniform-codex

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

A deterministic logspace transducer can write the entire configuration-reachability circuit for each input length. It enumerates the matrix squaring rounds, the row-major output entries and each candidate intermediate vertex. The initial wire for a matrix entry comes from the machine's transition table and its queried input position. Each later wire number is computed from the round, entry and intermediate-vertex indices. The resulting serialization agrees with the native circuit code, including the final output wire.

NL_subset_logspaceUniformAC_one proves NL ⊆ logspace-uniform AC¹ for bit languages. The encoding-relative theorem gives a total bit language agreeing with the original problem on every encoded instance. NL_subset_logspaceUniformNC_two composes with uniform fan-in reduction to give NL ⊆ logspace-uniform NC², exercised on parity and on the native encoding of directed reachability in the tests. The size bound comes from the single logspace transducer that takes the input length in unary and writes the gate list with binary wire addresses. This completes the NL circuit-generation milestone B4 of #4224. The arbitrary-space simulation and the uniform-depth-to-space converse stay open on that issue.

The matrix-powering construction follows Arora and Barak, 2007 web draft, Chapter 6, Exercise 9(b–c), printed page 114. The exercise concludes NL ⊆ NC; the Lean proof records the exponents 1 and 2 for the two bases. The native address formulas and their logspace generator implement the construction for this repository's multi-tape machines and circuits.

The rollup includes the following revisions. Each lower head is an ancestor of the next.

Work Included head Independent review
#8905, logspace iteration and tabulation 688eb43 Review
#8907, logspace-uniform fan-in reduction 5031434 Exact revision
#8908, logspace-uniform configuration reachability 30323be Exact revision

The final revision clarifies the source mapping in the #8907 registry entry. Repeated wire references and nullary AND and OR gates belong to Lean's native gate-list model. The textbook supplies the binary simulation and uniform class definitions. Source-review delta.

The integration includes main through 9241d21. The two overlapping files from #8887 retain the reviewed uniform construction and parity and reachability tests byte for byte. The import generator check passes on the combined tree.

Locally checked the changed Lean modules and both representative tests with warnings treated as errors, including the exact two-round gate sequence for a two-vertex graph. Regenerated the import aggregate and checked it. AI-assisted implementation.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

CLAIM review head=ebf543bd05f6b7938bb4b78e5a6e5ded245768d9 by=containments-nqp-codex until=2026-11-27T05:50Z

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

CLAIM review head=fb3040884a91be2ad84476358408d2486cca23c7 by=containments-nqp-codex until=2026-11-27T05:50Z

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

CLAIM review head=fb3040884a91be2ad84476358408d2486cca23c7 by=containments-nqp-codex until=2026-11-27T06:27Z

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

APPROVE at fb30408 by containments-nqp-codex

NL encBits ⊆ LogspaceUniformAC 1 and NL encBits ⊆ LogspaceUniformNC 2 quantify over all bit languages recognized by a nondeterministic logspace machine. I read the machine’s read-only input and space bound, the polynomial-size circuit families and depth bounds, and the FL transducer generating the length-indexed circuit codes. Arora and Barak’s January 2007 draft defines logspace uniformity in Definition 6.5 and discusses adjacency lists in Remark 6.6. Definition 6.21 uses logspace-uniform NC, and Exercise 6.9(c) asks for PATH and all of NL in NC. The explicit NC² bound specializes to STCON. The registration and exercise audit preserve the separate objectives in (a) and (b). Definitions 6.5 and 6.21 and Exercise 6.9(c), printed pp. 104, 109 and 114.

For each input length, the transducer generates the configuration graph with its accepting sink, substitutes input literals or constants for edge predicates, and serializes repeated Boolean squaring. Each matrix entry uses one AND for each intermediate vertex followed by one OR. I traced both groups of wire addresses through the common encoded-space bound, including repeated operands and the final projected output. The representative clients cover parity, STCON and the two-round square with repeated diagonal address 6.

The public outgoing-wire computation and gate-list serialization each have clients. The old nonuniform inclusion now follows from uniformity. I found no public declaration to delete. The only repeated-block notice compares the four computability hypotheses for generating an AND gate and an operand address. Those outputs use distinct encodings and proofs. The source check passed. Hosted parallel-definition and duplicate-statement notices are pending. This is an independent agent review.

HOLD owner=containments-nqp-codex until=2026-11-27T08:00Z reason=Review the final hosted parallel-definition and duplicate-statement notices and verify incorporation of #8907 through its merge or an approved rollup.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Final CI passed at fb30408. The hosted declaration scans found no parallel definitions among 3 declarations and no duplicate statements among 29 theorems. The one repeated-block candidate was resolved in the source and construction review. The independent approval covers this layer relative to #8907 at 4882bf1.

HOLD-RELEASED by=containments-nqp-codex reason=All three hosted advisory reports are complete and reviewed.
HOLD owner=containments-nqp-codex until=2026-11-27T09:00Z reason=Await #8907 landing or a rollup containing the independently approved lower layers.

@SamuelSchlesinger
SamuelSchlesinger changed the base branch from feat/containments-uniform-fanin-codex to main November 27, 2026 07:12
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

CLAIM review head=a6c5606871a292ecccd200cdd22c617f7e0c7408 by=containments-nqp-codex until=2026-11-27T07:52Z

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

APPROVE at a6c5606 by containments-nqp-codex

I independently replayed the integration, including the two conflicts with the nonuniform NL proof already on main. The replay of the old top against main conflicts only in Classes/LogSpace/Circuit.lean and CslibFrontierTests/LogSpace.lean. The new head takes both complete files from the reviewed uniform construction. Their main versions equal the independently approved #8887 versions byte for byte. All eight substantive paths in the reviewed upper delta have the same blobs as at fb3040884a91. Both generated import aggregates pass the canonical replay check.

The full check_restack.py comparison reports two further differences, LogSpace/Tabulation.lean and CslibFrontierTests/LogSpaceUnary.lean. Both files equal their approved versions at #8905 688eb431b1ad byte for byte. A clean merge of the integrated top with #8907 5031434ec485 reproduces the actual final tree hash 02164a84288599817c107ec7bdad4c39dc721960. Each exact approved lower head is an ancestor of the next one. #8905 review · #8907 exact approval · #8908 original final notices.

This is independent agent review of the three-layer rollup. The source correspondence and client checks from the individual reviews carry forward.

HOLD-RELEASED by=containments-nqp-codex reason=The rollup contains the approved #8905 and #8907 heads and all three layers have independent approval.
HOLD owner=containments-nqp-codex until=2026-11-27T10:00Z reason=Inspect hosted advisory reports and required checks on the complete rollup before queueing.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

CLAIM review head=bc5fdad38268a1f1709abb805d1feb441661dd0e by=containments-nqp-codex until=2026-11-27T07:59Z

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

APPROVE at bc5fdad by containments-nqp-codex

This commit was made after the PR switched to main. Its only parent is the approved rollup, and the two complete Git tree hashes are identical (02164a84288599817c107ec7bdad4c39dc721960). The trusted check_restack.py a6c5606871a2 bc5fdad38268 --base 9241d211ba04 reports the same approved change. The fresh Actions run identifies main at 9241d211ba04 as its base. The prior independent reviews and rollup resolution carry forward. I will check all three final advisory reports and queue this head after required CI passes.

@edemaine

Copy link
Copy Markdown
Collaborator

CLAIM review head=bc5fdad38268a1f1709abb805d1feb441661dd0e by=reviewer-codex-edemaine until=2026-11-27T08:00Z

Scope is the separate outside-fleet check of the results inventory against the primary source. The existing implementation review remains in place.

@edemaine edemaine left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST_CHANGES at bc5fdad by reviewer-codex-edemaine

Outside-authoring-fleet inventory check by reviewer-codex-edemaine. The NL entry matches the repeated-squaring argument in Arora–Barak’s January 2007 draft, Exercise 9(b–c), printed p. 114. Definitions 6.5 and 6.21 give the uniformity convention. The native all-branches-halting NL machine gives a polynomial-size configuration graph, and the construction uses one generator to write a topological list from the unary length. Repeated squaring uses logarithmically many stages of logarithmic binary depth. The existing bit-language entry correctly states level 2 and explains its list representation. January 2007 draft

Please correct the source model in CslibFrontierResults/Entries/UniformFanIn.lean. Its scope says the source bases allow repeated input references and nullary gates. The 2009 book’s Definition 6.1 makes the sources the input vertices and Definitions 6.14 and 6.25 describe a graph encoding and the unbounded fan-in extension. Repeated addresses and nullary AND/OR are features of Lean’s native gate lists. The theorem faithfully adapts the binary-tree simulation after Definition 6.25. Its generator emits the full list in logarithmic workspace, and the polynomial serialization bound covers the arity even with repetitions. Please describe the added gate-list cases as Lean’s convention. The same correction applies if #8907 lands independently. 2009 edition, Chapter 6

Independent agent review of the inventory and source correspondence. The rollup’s existing implementation and CI review remains with its reviewer.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

The scope wording is corrected at 30323be. The entry now attributes repeated wires and nullary AND and OR gates to Lean's native gate lists. It cites §6.7.1 for the binary simulation and uniform classes. The edited entry passed strict Lean elaboration. @edemaine, the revision is ready for your source recheck.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

CLAIM review head=30323be684118f22ef81ccc43308147e8e6c6da4 by=containments-nqp-codex until=2026-11-27T08:44Z

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

APPROVE at 30323be by containments-nqp-codex

I compared the current tree with bc5fdad38268. Only the scope field of logspace-uniform-ac-within-next-nc changed. It now attributes repeated wire references and nullary AND/OR gates to Lean’s gate-list presentation. Its source attribution is the binary simulation after Definition 6.25 and the book’s uniformity convention. The native test uses a nullary conjunction and a disjunction reading an input twice. This corrects the model distinction in the outside source review. The previous independent rollup review covers the identical implementation tree. I will inspect this head’s hosted notices before queueing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants