Skip to content

refactor(Complexity/LogSpace): name the log-space clock exponent - #4831

Merged
SamuelSchlesinger merged 4 commits into
mainfrom
refactor/cx-logspace-clock-exponent
Nov 13, 2026
Merged

SamuelSchlesinger merged 4 commits into
mainfrom
refactor/cx-logspace-clock-exponent

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #4737. Follows #4812.

The log-space clock exponent 2 * (8 + 2 * Nat.card (Option State) + 200 * k) * (c + 1) appeared five times: in the statement of two_pow_coreLengthBound_log_le and in four clients that copied it to match that statement (Reachability, Randomized/PolyTime, Randomized/ConfigurationMatrix, Alternation/Space). This PR adds Turing.MultiTapeNTM.logSpaceClockExponent k State c next to the lemma in LogSpace/Configurations and states the lemma as ≤ polyClock (logSpaceClockExponent k State c) n. Clients now name the exponent instead of keeping a private copy of a constant that must agree with an internal bound. Naming it also shortens the lemma's proof to a rw plus gcongr, with no set/calc.

This is refactoring only, with no new mathematics. Net −2 lines (+20/−22) across 5 files. Proposed by c04e5978 in the review of #4812.

Manuals: no edit needed. The Operator's Manual (native-and-resources.md L107) names polyClock d n but not the exponent's formula, and its anchors are unchanged. Nothing in the Agent Operator's Manual concerns this declaration.

Validation at 609bdc7, approved by c04e5978. Head ed053bd merges main after #4812 landed: conflicts were resolved to this side, the diff against main is byte-identical to the approved delta, and the targeted build and manual checks were rerun:

  • lake build --wfail --iofail of Configurations, HaltingTime, Reachability, Randomized/PolyTime, Alternation/Space and Randomized/ConfigurationMatrix, plus the intermediate importers Lake rebuilt (Randomized, Amplification, Alternating.Views/Marking, BoundedSearch).
  • lake exe lint-style, check_operator_manual.py, check_hygiene.py --check-simp, both ratchets and proof_copies.py all pass.
  • parallel_defs.py --theorems reports nothing. The comparison is incomplete because 404 unbuilt modules were not compared.
  • CI covers the full build of the other importers of Configurations.

AI disclosure: written by a Jetski worker agent (session 38db7bed) under plan #4737. Agent review only, not human review.

copositive added 3 commits November 12, 2026 22:28
…s count from BPL_subset_P

`Turing.MultiTapePTM.computableInPolyTime_acceptCoins`: under a logarithmic
space bound, the number of accepting coin strings is computed exactly in
polynomial time at any polynomial-time unary horizon; halting is not needed.
`BPL_subset_P` now obtains the clock, applies it and compares with two thirds
(113 -> 27 lines).

The extracted proof reuses `computableInPolyTime_initView` and
`computableInPolyTime_acceptingView`, proves the unary clock by `fun_prop` and
the table-size bound by `growth_poly`. The same simplifications apply to
`exists_computableInPolyTime_search`, whose round count becomes `polyClock`,
removing the private `rounds_le` restatement of
`two_pow_coreLengthBound_log_le` and the hand-written view-length bound that
PolyTime copied.
Add Turing.MultiTapeNTM.logSpaceClockExponent next to
two_pow_coreLengthBound_log_le and state that lemma over it, so the four
clients (Reachability, Randomized/PolyTime, Randomized/ConfigurationMatrix,
Alternation/Space) name the exponent instead of copying its formula.

Part of #4737.
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Agent review (Jetski reviewer session c04e5978, for coordinator 33f8b11c) of 609bdc7: approve (the diff against its stacked base refactor/cx-bpl-acceptcoins, i.e. #4812). This is agent review, not human review.

The PR names the log-space clock exponent Turing.MultiTapeNTM.logSpaceClockExponent k State c := 2 * (8 + 2 * Nat.card (Option State) + 200 * k) * (c + 1), placed beside coreLengthBound and two_pow_coreLengthBound_log_le in LogSpace/Configurations.lean. It restates the theorem as … ≤ polyClock (logSpaceClockExponent k State c) n and migrates every copy: Reachability, Randomized/PolyTime, ConfigurationMatrix and Alternation/Space. After the change the exponent is spelled out only in the definition. HaltingTime and the other users of two_pow_coreLengthBound_log_le pick it up unchanged. The new proof (rw [h, pow_succ', pow_mul, polyClock]; gcongr) is shorter than the old calc. The definition sits in the file's @[expose] public section, which is right for an arithmetic bound that clients may need to unfold. The name and docstring are clear.

Not in scope, and fine as is: the coefficient 8 + 2 * Nat.card (Option State) + 200 * k still appears in coreLengthBound, in set B in ReachableViews and in Alternation/Space (mem_EXP), and as 10 + … in Machine/Space. That is a different quantity (the code-length constant). If its repetitions cause friction, it can be named later. It is not a blocker here.

CI at this head is green (ci-checks, guide). The Repeated-proof-block, Parallel-definition, Duplicate-statement and PR-description-names notices are empty. The build job does not run against a stacked base, so it will run once this PR targets main.

Stacking: after #4812 lands and this branch merges main and retargets, I need to review only a delta that goes beyond conflict resolution. No other review or thread is open on this PR.

Base automatically changed from refactor/cx-bpl-acceptcoins to main November 13, 2026 00:10
…clock-exponent

# Conflicts:
#	CslibFrontier/Computability/Complexity/Classes/LogSpace/Randomized/PolyTime.lean
#	CslibFrontier/Computability/Machines/Turing/MultiTape/Complexity/LogSpace/Reachability.lean
@SamuelSchlesinger
SamuelSchlesinger marked this pull request as ready for review November 13, 2026 00:18
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Agent review (Jetski reviewer session c04e5978, for coordinator 33f8b11c) of ed053bd: approve. This is agent review, not human review.

The approval of 609bdc7 carries over. The only change since then is the #4812 merge: git diff 0ba61be055 ed053bd0a1 is byte-identical to the approved 0412311..609bdc7 delta (5 files, +20/−22), and it merges cleanly into current main. ci-checks passes on this head and its advisory notices are empty. The Operator's Manual PDF build doesn't run because no manual files changed. No other reviews or threads are open.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit b446cc8 Nov 13, 2026
8 of 13 checks passed
@SamuelSchlesinger
SamuelSchlesinger deleted the refactor/cx-logspace-clock-exponent branch November 13, 2026 01:26
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.

1 participant