Skip to content

feat(logspace): serialize the clocked compact coin matrix - #1793

Merged
SamuelSchlesinger merged 7 commits into
mainfrom
feat/logspace-clocked-table
Oct 31, 2026
Merged

SamuelSchlesinger merged 7 commits into
mainfrom
feat/logspace-clocked-table

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

#1791 gives the canonical clocked BPL matrix. This PR proves native logarithmic-space computation of its complete two-bit matrix payload from the original framed word, starting from the actual zeroed initializer. Flat identifiers split into clock and base components; the reader queries the original input using the base source, and emits the ordinary coin count exactly when the target clock is the next one.

The library proves exact output length, row-major indexing, count decoding, zero terminal rows and equality of every decoded entry with finTimeLayer of the compact coin matrix. Local native space certificates also compute the dimension and terminal reward, with the reward identified with finTimeLayerReward. The existing ordinary table and clocked table share one two-bit format and one 23-label, four-register writer. The previous ordinary instruction list and register count are definitionally preserved, along with its public execution/resource guarantees.

Stacked on #1791; advances #1444. The complete matrix payload is now initialized and natively computable. Packaging dimension/start/reward into one serialized instance, directed paired ports, the recursive estimator and its complete space realization remain open. The existing startID_budget is reused; no composed-instance theorem or bounded indegree is assumed. No selected abstract or roadmap endpoint changes are warranted.

Validation and review

All eight changed/new libraries and three regression clients pass strict pinned Lean with project options and warnings as errors, without diagnostics. Actual initialized runs emit all 1,152 bits of a 24-ID clocked system. Tests cover clock-one sources, counts one/two, off-clock and terminal zeros, exact matrix/reward decoding, and rfl preservation of the old writer. Existing input dependence, malformed IDs, exact overflow mass, acceptance and BPL-witness regressions still pass. Focused hygiene, tracked aggregate, committed-import and whitespace checks pass. Full Lean CI passed for the published revision.

Independent non-author agent polynomial_false_review approved exact source 9d493c2146a15bcf7180a6ccc197ff045287eeaf with no substantive findings; a module-heading nit and final explicit test parameters were covered before approval. Integration preserves the reviewed source/test bytes. Published revision.

AI assistance: ChatGPT worker coin_input_review authored and validated this layer; separate agents reviewed and integrated it. The proof continues the pinned paper's terminal-time construction using this project's native machines; no OAI Lean code was used.

Read each fixed-coin edge of the compact configuration graph and add the
two contributions, preserving multiplicity when the successors coincide.
Certify the count and live-count routines with the existing native space
combinators. Prove normalized tape and canonical-view ID injectivity, then
identify the queries with actual configMatrix/liveConfigMatrix entries.
Reachable-logspace corollaries derive the representation conditions from
RunsInSpace at the prescribed polynomial radix.

Tests use actual zero-tape machines and reachable views to distinguish
zero, one and two coin branches, absorbing and zero-live halted rows,
invalid IDs, and the exact binary argument space certificate.

Validation on base df2279f plus this four-file diff: all three modules and
the test pass direct Lean 4.36.0-rc2 checks with warningAsError=true and
repository linter options, with no diagnostics. Focused hygiene
--check-simp and staged git diff --check pass. Outputs are isolated and
shared compiled dependencies are read-only. Aggregate wiring, independent
review and the full CI gates are left to the coordinating integration.

This is local matrix access, not bounded vertex enumeration, time layering,
an estimator implementation or the BPL subset L endpoint. No selected
abstract or catalogue impact. AI assistance: ChatGPT (GPT-6 Astra), worker
codex-logspace-coin-multiplicity-20261030, wrote and validated these files.

Independent non-author source/API review by compression_review approved exact source revision be84b9de9d7de13f0d99a3ceb54649ef57f9f7d2, including native resource certificates and exact configuration-matrix bridges, with no findings. Reviewed source files are unchanged after integration onto updated main.
Integrated strict source/test builds, tracked aggregate check, whitespace and committed import checks pass. Full integration gates run in PR CI.
Construct a time-layered matrix with edges only to the next clock layer,
terminal-only reward, and the explicit remaining-horizon potential. Prove
strict upper triangularity, substochasticity, bounds on every potential
coordinate, the linear-system identity, determinant one, and its inverse
solution. This follows the ordinary absorbing-matrix convention of the
pinned model.tex Lemma 2.1 (OpenAI2026LogSpace, revision 7ef5c0cc).

Specialize to the actual half-normalized fair-coin configuration matrix
and prove its clock-zero potential is the native finite-time acceptance
frequency and the existing finite sum of first-stop live terms. Identify
clocked entries with the certified compact-ID coin-count reader. Apply the
existing BPL configuration-matrix theorem to obtain concrete polynomial-size
strict-forward systems with bounded potential and the 2/3 versus 1/3 gap.

Tests realize a zero-work-tape machine that loops on false and accepts on
true. They prove its actual two-step acceptance probability is 3/4 and
read a nonzero clocked edge from the compact IDs. Additional checks cover
an absorbing matrix, terminal-only reward, zero horizon, the explicit
linear system and inverse, and the exact clocked cardinality.

Validation on base 406a68d plus this three-file diff: both library modules
and ComplexityTests/TimeLayer.lean pass direct Lean 4.36.0-rc2 with
warningAsError=true and repository linter options, without diagnostics.
Focused check_hygiene.py --check-simp and staged git diff --check pass.
Builds use only tiny isolated outputs and read-only compiled dependencies;
there are no Lake/cache/bootstrap operations. Aggregate registration and
full CI gates remain for coordinating integration. The final independent
review is pending; the two unchanged library snapshots already received
a no-findings source review from lean_environment.

This is a concrete semantic reduction. Bounded vertex enumeration,
composition with whole-input symbol access, incoming paired ports, the
recursive estimator, and the native BPL subset L endpoint remain open.
No selected abstract or catalogue impact. AI assistance: ChatGPT
(GPT-6 Astra), worker codex-time-layer-20261030, wrote and validated the
three files.

Independent non-author review by lean_environment approved exact source commit dafd85f98e5fd78eec31900dff411b0c5bf8c138 with no findings; integrated library and test bytes match that snapshot.
Integrated strict source/test builds, tracked aggregate check, whitespace and committed import checks pass. Full integration gates run in PR CI.
Extract STCON's five-instruction input-symbol reader and its bounded
ReachesOut proof into ConfigurationGraph.ReadSymbol, then make the
existing STCON writer reuse both without changing its instruction labels.

Compose that actual reader with the two fixed-coin arithmetic edge tests.
The six-instruction block returns the exact 0/1/2 multiplicity in its
scratch register, reads the original framed input, preserves the length
and IDs, and emits nothing. Its concrete four-register program has native
linear-space certificates for its query and execution callbacks.

The entry length and compact IDs are preloaded explicitly. This is a
native input-reading component, not a completed ambient enumeration,
paired-port construction, or whole Phase 1 reduction.

Focused validation: direct Lean 4.36.0-rc2 with the project options and
-DwarningAsError=true passed without diagnostics for ReadSymbol,
FairCoin.ReadInput, STCON.Reduction, STCON.Completeness, the new
FairCoinInput tests, and the existing STCON tests. New tests read true,
false, absent and empty-input symbols and prove bounded runs of an actual
input-dependent machine with fixed compact IDs returning 0, 1 and 2.
The hygiene check with --check-simp and git diff --check also passed.
Shared dependency outputs were read-only; all direct-Lean outputs were
private. Full repository CI and aggregate registration remain integration
work. Independent exact-revision review is requested separately.

AI assistance: ChatGPT worker codex-coin-input-20261030 implemented and
self-checked this change under the coordinating agent's agreed scope.

Independent non-author agent coin_input_review approved exact source commit 46dcedfed969a806887fb0fa3bcf04840530c940 with no findings and independently checked the behavioral tests. Integrated source/test bytes match that reviewed snapshot.
Integrated strict source/test builds, tracked aggregate check, whitespace and committed import checks pass. Full integration gates run in PR CI.
Enumerate every compact source/target pair from the actual zeroed counter
program initializer on the original framed input. Reuse the existing word
header, fair-coin input reader, counting-loop API, and row-major list API.
Each two-bit entry records the exact count zero, one, or two, including
coincident successors. Prove the entire transducer computable in native
deterministic logarithmic space, with no preloaded parameter hypothesis.

Move the existing STCON polynomial counter-bound proof into the shared
configuration-graph layer and migrate STCON without weakening its result.
Clocked enumeration, paired ports, the strict-forward-system bridge, and
the recursive estimator remain open. No headline abstract or roadmap
endpoint changes are warranted by this component milestone.

Validation: strict direct Lean with project options and warningAsError=true
passed without diagnostics for CounterBounds, FairCoin/Table, the new
FairCoinTable tests, STCON Reduction, STCON Completeness, existing STCON
tests, and existing FairCoinInput tests. Focused hygiene with --check-simp
and git diff --check pass. New tests use actual initialized runs with 1458
output bits and nonzero input-dependent entries, coincident successors,
empty input, and exponent zero. Full integration gates are left to PR CI.

AI assistance: ChatGPT implementation worker coin_input_review authored
this change. Independent non-author review is pending; the worker's prior
review role on its parent change does not approve this implementation.

Independent non-author agent polynomial_false_review approved exact source bb96980f7ce0502b155e116b8fff38bee416cb23 with no findings. Integrated source/test bytes match the reviewed revision.
Integrated strict source/test builds, tracked aggregate check, whitespace and committed import checks pass. Full integration gates run in PR CI.
Connect the initialized native coin-count table to the matrix on every compact
configuration ID. Prove deterministic target uniqueness on arbitrary IDs,
nonnegative substochastic rows, and exact finite-time machine acceptance from
the original logarithmic-space witness, deriving the initial ID and all fitting
conditions internally.

Reuse time layering on explicit Fin ((T+1)*N) identifiers, preserving numeric
strict forwardness, terminal reward, bounded potential and inverse equations.
The real-valued BPL endpoint keeps the original space constant and supplies a
polynomial dimension and the actual two-thirds versus one-third gap.

Reusable pieces are closed-submatrix multiplication/power restriction, finite
clock reindexing, and a shared polynomial bound for the clocked compact box.
Expose the existing canonical reachable-output lemma instead of re-proving it.
Clocked native serialization, directed paired ports and the native recursive
estimator remain open; this is not BPL containment in L.

Validation on the exact changes from published parent
 a14b3f2:
- All seven changed/new library modules and the concrete new test pass the
  pinned Lean 4.36.0-rc2 compiler with project options, warningAsError and
  --error=warning, using private artifacts and existing read-only dependencies.
- Eight affected existing source/test checks pass: FairCoin/Table, STCON
  Reduction and Completeness, randomized TimeLayer, and FairCoinConfigurationReader,
  FairCoinTable, TimeLayer and STCON tests.
- Regression cases cover malformed in-box IDs, an overflowing rejecting branch
  with exact surviving row mass one half, actual finite-coin acceptance through
  both matrix bridges, numeric clock splitting, terminal-only reward and zero
  terminal rows, plus a concrete always-accepting BPL witness.
- Focused check_hygiene.py --check-simp and git diff --check pass.
Full project gates and aggregate registration are delegated to integration CI.

AI assistance: ChatGPT worker coin_input_review authored and self-checked this
change. A separate read-only helper identified existing matrix transport APIs.
Independent non-author review of the frozen revision is pending coordinator
integration; self-checking is not independent or human approval.

Independent non-author agent polynomial_false_review approved exact source e3528ff495f376640e72a89414a7b85223ff1ca0 with no findings. Integration preserves the reviewed source/test bytes.
Integrated strict source/test builds, tracked aggregate check, whitespace and committed import checks pass. Full integration gates run in PR CI.
Factor the existing row-major two-bit specification and initialized
four-register writer for ordinary and clocked clients. Preserve the
ordinary program definitionally and retain its public certificates.

The clocked writer reads the original frame from zero registers, splits
flat IDs into clock/base components, and emits the exact guarded 0/1/2
coin count. Prove length, indexing, terminal-row zeros, native logarithmic
space, and equality with finTimeLayer of the compact coin matrix on every
bounded numeric ID. Add local native dimension/reward certificates and
identify the reward with the existing terminal reward. Complete instance
packaging, paired ports and the native estimator remain open; no new
headline or abstract is claimed.

Validation: pinned Lean 4.36.0-rc2 with warningAsError, --error=warning,
autoImplicit=false and the repository strict linters passed for all eight
changed/new library modules and ClockedCoinTable, FairCoinTable and
CompactConfigurationMatrix tests. Concrete tests cover initialized
1152-bit runs, a clock-one source, counts one/two, off-clock and terminal
zeros, exact matrix/reward interpretation, and definitional preservation
of the old 23-label program. Existing input-dependence, malformed-ID,
overflow-mass, acceptance and BPL-witness regressions still pass.

Explicit-path hygiene with --check-simp and git diff --check pass.
Validation used isolated temporary outputs and existing read-only
dependency artifacts; no Lake/cache/shared builds were run. Full CI and
aggregate import registration are delegated to the coordinator.

AI assistance: ChatGPT authored and validated this change. Independent
agent review of the exact revision is required before integration.

Independent non-author agent polynomial_false_review approved exact source 9d493c2146a15bcf7180a6ccc197ff045287eeaf with no substantive findings, including the final test delta. A module-heading nit was fixed. Integration preserves the reviewed source/test bytes.
Integrated strict source/test builds, tracked aggregate check, whitespace and committed import checks pass. Full integration gates run in PR CI.

@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.

Independent agent approval by reviewer-codex-edemaine of 1cd5437. Read the complete ten-file layer over reviewed #1791, including the shared writer, actual input-reader semantics, clock arithmetic, native resource contract and regressions. No blocking findings.

The source quotient/remainder selects the correct base input query at every clock. Only consecutive-clock pairs receive the ordinary 0/1/2 count; bounded terminal rows are zero. Exact row-major decoding identifies the emitted bits with finTimeLayer, and the reward predicate pays only at the terminal clock. Fixed machine/radix/clock exponents precede inputs. The initialized writer derives length from the original frame, bounds all four registers including final counters polynomially, and obtains native logarithmic workspace with input/output excluded and unrestricted time. Local dimension/reward budgets retain their explicit short-argument/input-budget premises.

The shared two-bit format and writer preserve the ordinary table and its public execution/resource statements; the old 23-label instruction list and four-register structure remain definitionally equal. Tests discharge actual 1,152-bit initialized runs, clock-one sources, multiplicities one/two, off-clock and terminal zeros, and matrix/reward decoding. Source mapping reuses the checked terminal-time construction in pinned Lemma 2.1, pp. 7–8. Complete instance packaging, paired ports and estimator realization remain open; no curated-abstract impact.

Aggregate coverage (3,054 modules) and whitespace pass. At the single inspection title passed; Lean 41119503975, Guide and Comparator were running. Author reports strict affected-client checks; no local Lean build by this reviewer. Live head/history rechecked before posting. Agent review, not human approval.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

integrator-claude-e6cf7b0d-b (integration delegate of coordinator-claude-e6cf7b0d, at Samuel's request): parent #1791 has merged, so I am retargeting this to main, merging main into this branch to resolve conflicts, and landing it.

Parent #1791 has landed. The add/add conflicts take this branch's side:
main's copies are byte-identical to #1791's head. Complexity.lean
regenerated by mk_all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
@SamuelSchlesinger
SamuelSchlesinger changed the base branch from feat/logspace-compact-matrix to main October 31, 2026 02:41
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

integrator-claude-e6cf7b0d-b (integration delegate of coordinator-claude-e6cf7b0d): mechanical carry-forward. Retargeted to main after #1791 landed, and merged main at ff6f4040b8e2113f896a51094c4016a334b3949c. The three add/add conflicts (CompactMatrix.lean, CompactTimeLayer.lean, FairCoin/Table.lean) take this branch's side; main's copies are byte-identical to #1791's head (checked with cmp). Complexity.lean was regenerated with mk_all. Approved 1cd5437a331eaa290543615d733e728c2c384499 → ff6f4040b8e2113f896a51094c4016a334b3949c: payload +/- lines identical to the own layer over #1791; mk_all --check ok. I will queue once CI passes.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 630e0d9 Oct 31, 2026
4 checks passed
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