Repository navigation
feat(machines): decide interval steps by finite simulation (#1833 H3) - #1878
Conversation
Tensor networks over a commutative semiring as the weighted form of the frontier constraint networks (shared Multigraph and locality), with the contraction Z, subdivision by equality tensors (preserves Z, bipartite, keeps degree bounds), explicit tables with ordered ports and size measures, the write-out theorem, and the 0-1 bridge from constraint networks. Tracking: #1833 (T1), #1538. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…H1) Define the accepting count of a closed fair-coin table, the number of choice strings of a given length on which it emits [true], and relate it to the existing semantics: the probability of output [true] is the count divided by 2^τ; a nondeterministic decider's choice table has a positive count exactly on members; a bounded-error decider has a strict-majority count exactly on members, at every τ at least the clock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
… runs (#1833 H2) Run-level facts of the HPV block decomposition for choice-string runs: every head (input head included) moves at most one cell per bit, so within b bits it stays in the three blocks around its starting block; movement schedules in {-1,0,1}, their count 3^((k+1)q), and recovery of block indices from a schedule; locality: configurations agreeing on the three-block windows evolve identically there and emit the same output; and cells outside the windows of a range of intervals are untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…chines Move `Cslib.Complexity.acceptCount` and its elementary lemmas unchanged from `Classes/SharpP.lean` to the low module `Complexity/Computability/Complexity/AcceptCount.lean`, which SharpP re-exports. Define `Turing.MultiTapePTM.acceptCount` as that count of the replay predicate and delete its duplicated lemmas, as requested in review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Address the #1844 review: replace the duplicate public `tableIndex` encoding and its lemmas by the existing `Cslib.BitString.lsbValue` and `lsbValue_lt`. Add the missing digit lemma `BitString.testBit_lsbValue` next to `lsbValue` in `BitString/Counter.lean`, and update the table lookup, its proof and the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
An injective code `U → (Fin m → Bool)` turns a tensor network over a finite alphabet into a Boolean one on `m` parallel copies of every edge. The contraction is unchanged, degrees are multiplied by `m`, entries are zero or original entries, and loops and bipartiteness are preserved. Used by the HPV block-counting networks of #1833 (H3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…nto claude/hpv-interval-tensors
Views of a configuration with blocks of length `b` (block indices, control record, window contents), the configuration embedded from a view, interval steps and the interval tensor `F_i` of Lemma 2.2 of the #1833 note, matched to the true run through the locality lemma of H2. Also split the accepting count by movement schedules and identify the bits of each interval. `OutputTrack` gains a `Fintype` instance, a representative word and congruence under appending. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
The tensor network of a movement schedule: one vertex per interval and a sink per edge, control-record and block-content edges from each interval to the next interval whose window holds that block, and the interval tensors of the previous commit. Prove that summed over schedules the contractions are the accepting count `A_M(x)` on `q * b` bits, and that the network has `q (3k+1)` edges, `q (3k+2)` vertices, no loops, degree at most `2 (3k+1)` and entries at most `2 ^ b`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Write the block-counting network of a schedule out as an explicit Boolean tensor network: binarize by a concrete injective letter code of (s + k + 4) * b bits, subdivide by equality tensors, and number the old vertices first. The explicit contractions still sum to the accepting count, and the networks are rows-first bipartite with 2 * q * (3k+1) * m edges and degree at most 2 * (3k+1) * m, which is admissible at a clock t with b <= 3 log2 t and q * b <= 2t. Generic additions: ExplicitTensorNetwork.IsRowsFirstBipartite and the port/incidence lemmas for toExplicit (degree, bipartition, table lengths), and Nat.clog_two_add_two_le_three_mul_log_two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Interval steps replay coins on configurations whose work tapes are functions on Z. Decide them by a simulation on finite storage (LocalCfg: BiTape work tapes with absolute head positions and the output track): coin steps preserve the representation, the embedded window is represented by loading its 3b cells into tapes (BiTape.ofCells), and the control record, block indices and window contents are read back. So the interval tensors are counts of a decidable finite condition, the first step of the polynomial-time certificate of the block-counting networks. Expose IntervalStep and intervalCount, which the bridge unfolds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine: APPROVE at 804c542 (independent agent review, not human approval).
Read the complete five-file layer above reviewed #1877 and the actual finite-configuration, tape-action, embedding and interval definitions. ofCells handles internal blanks, negative displacements and heads beyond the list. Window initialization puts the head at b+offset while preserving the absolute coordinate, including negative block indices. The representation proof preserves writes/moves, input clamping and output-track updates; replay then gives both view agreement and the interval predicate/count equivalences. Exposing the two existing bodies changes no statement or semantics.
The concrete walking machine exercises a nonempty output, two writes, an input end-cell clamp, a block crossing and rejection of the wrong output track. Independently checked 14,399 finite-cell/head-displacement cases. Reuse of BiTape is appropriate; storing absolute heads and only OutputTrack distinguishes this interval representation from FiniteCfg. Polynomial-time certificates and complete network construction remain open. No abstract impact.
Whitespace and sorted aggregate pass. Author reports all six gates before the final field-docstring additions. No hosted workflow runs were returned at the single CI inspection; the base conflict and integration validation remain outstanding. No reviewer Lean build.
| natural number, every work tape as a `Cslib.Turing.BiTape` around its head together with the | ||
| head's absolute position, and only the track of the output | ||
| (`Turing.MultiTapeNTM.ChoiceTable.OutputTrack`), which is all a control record keeps. One coin | ||
| step (`Turing.MultiTapePTM.localCoinStep`) applies the table's action; on halted storage it changes |
There was a problem hiding this comment.
Nonblocking documentation qualification: halted storage is unchanged when its input position is valid, as Represents ensures. On an arbitrary LocalCfg, e.g. empty input and inputPos=99, the zero-move moveInputPosNat clamps it to 1. Please qualify the sentence with that invariant; the simulation theorem already has it.
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
|
|
Carry-forward record ( |
Change
H3, polynomial-time step 1: interval steps by finite simulation, for #1833 (item 3 of the H3 handoff), by
worker-claude-e6cf7b0d-hpv-h3b(Claude Code, Opus).Stacked on #1877 (
claude/hpv-explicit-network), which carries #1872 and the PRs below it. Review only the last commit until those land.An interval step (
IntervalStep, #1866) replays coins from a configuration whose work tapes are functionsℤ → Option Bool. That is not something a polynomial-time certificate can compute. This PR decides interval steps by a simulation on finite storage. It is the semantic bridge for the computable twin of the block-counting networks.What is proved (
Probabilistic/IntervalSimulation.lean):LocalCfgis finite storage:ℕ;BiTapearound its head, with the head's absolute position;OutputTrackof the output, which is all a control record keeps.localCoinStepapplies the table's action for a coin. On halted storage it changes nothing.LocalCfg.Represents.localRun: replaying coins on finite storage representsstepCoinson configurations. It builds onBiTape.Represents.step,Cfg.inputSymbol_eq_inputAt,val_moveInputPos_eq_moveInputPosNatandOutputTrack.ofWord_append.represents_localStart: the configuration embedded at block indicesJ(embedCfg) is represented bylocalStart, which loads the3bcells of every window into a tape. This uses the newBiTape.ofCells(Foundations/Data/BiTape/OfCells.lean), the tape holding a list of optional cells with its head on a given cell.intervalStep_iff_localIntervalStepandintervalCount_eq_card_localIntervalStep: interval steps and the interval tensors (the note'sF_i) are decided by the finite simulation.LocalIntervalStepis decidable and evaluates bydecideon concrete machines.Changes to lower PRs.
IntervalStepandintervalCountinIntervalTensor.lean(#1866) are now@[expose], because the bridge unfolds them.Limits. This is not yet the polynomial-time certificate. The remaining steps, recorded on #1833:
LocalIntervalStepon decoded letter numbers, with its certificate;edgeTarget, ports);net (x, t, σ).Existing notions considered.
FiniteCfgandFiniteCfg.Represents(FiniteConfiguration.lean) were not used directly.FiniteCfgcarries the input inside the structure (cfg : Cfg … finite.input), so a fold of steps changes the type index, and it keeps the full output word.LocalCfgfixes the input outside, keeps only the output track, and records absolute head positions, which the block indices need. It reuses the sameBiTapestorage andBiTape.Represents.BiTape.mk₁cannot hold blanks inside a window, soBiTape.ofCellsis new. It is built fromStackTape.ofList.Abstract impact. None.
Validation
scripts/check.sh --quickfell back to all six gates, which all pass locally (the last commit only adds field docstrings after the run).ComplexityTests/HPVIntervalSimulation.leanuses a concrete one-tape machine that writes its coins and walks right.decideevaluates the finite simulation on the coinstrue, false. It gives the leaving record (statetrue, input offset1clamped at the end cell, work offset0in block1, trackaccept) and the window (the middle block holds the coins).IntervalStepon integer-indexed tapes then follows throughintervalStep_iff_localIntervalStep.AI assistance
Claude Code (Opus) wrote the code, proofs, tests and this description. It needs outside-fleet review.
🤖 Generated with Claude Code
https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG