Repository navigation
feat(machines): the tables of explicit block-counting networks on numbers (#1833 H3) - #1909
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
Make firstAfter/lastBefore and their characterizations public, add firstAfter_eq_none_iff, expose inWindow, IntervalHolds and edgeTarget, and state the sources, targets and tensors of blockNetwork as public lemmas, so that a computable twin of the network can be proved equal to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Restate the interval tensor on plain data: control records with offsets as natural numbers and windows as their 3b cells. Block indices and offsets are compared without division (z = b q + r with r < b), and the count runs over the enumeration of coin strings. localIntervalCount_eq_intervalCount relates it to the semantic interval tensor; a test evaluates it on a concrete machine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Encode finite storage (encLocalCfg) and certify one coin step by finite dispatch on the control, read symbols and coin, with a constant bound on the growth of the encoding; replays are then a fold with additive growth (computableInPolyTime_localRun). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…l time (#1833 H3) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
The arguments of an interval count (IntervalData) with their encoding; the finite storage of the embedded window and the interval test after the replay are polynomial-time, so computableInPolyTime_localIntervalCount counts the 2^b coin strings in polynomial time whenever they are polynomially many in the input. The test instantiates the certificate on a concrete machine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…ers (#1833 H3) Number the schedules by base-3 digits (`scheduleEquiv`, `scheduleOfNat`), compute block indices as digit counts, windows and next appearances by comparison and search, and the endpoints and ports of the explicit edges by arithmetic. `map_fst_vertices_explicitBlockNetwork` equates the ports with those of `explicitBlockNetwork`, and `computableInPolyTime_explicitPortsNum` certifies them in plain polynomial time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
`map_val_explicitPorts` gives the ports of any vertex of the binarized, subdivided network for any letter code; `map_fst_vertices_explicitBlockNetwork` now follows from it. The table twin uses the per-vertex form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…bers (#1833 H3) Decode letter numbers into control records on plain data and block cells, compute the window entering an interval (`lastBeforeNum`, `portOfNum`), and evaluate the tensors of the block-counting network from letter numbers (`blockNetwork_tensor_decodeLetter`). Reading the letters from the table index and the ports gives every table entry on numbers, so `explicitBlockNetwork_eq_explicitNetworkNum` computes the whole explicit network. `computableInPolyTime_explicitNetworkNum` certifies it in plain polynomial time when `2 ^ b` has a computed unary bound. Adds the public `ControlData.computableInPolyTime_mk`. 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 f16d8e4 (independent agent review).
Read the complete five-file layer, reusing #1897/#1900's unchanged interval/graph coverage. Control/contents decoding inverts the actual numbering; large-number defaults remain total. Reverse search selects the latest earlier window, and port arithmetic matches the existing truncated total definition (on a matching window its offset is 0..2). Interval tensors count exactly the same coin strings, reject wrong outgoing letter kinds, and preserve the entering control/window data. Invalid letter codes are rejected at incident edges; source/target halves and subdivision equality match the existing binarized network. The final theorem is equality of the complete explicit networks, not merely their contractions.
The plain polynomial-time certificate charges input, unary b/q and a computed unary cap≥2^b; state count and tape count are fixed. The degree bound makes each materialized table polynomial in cap, including zero intervals and out-of-range vertices. ControlData's constructor certificate is placed with its encoding. Checked examples cover a real accepting count, accepting/rejecting sinks, a subdivision table and the closed certificate. Independent checks cover 1,680 control records and 6,561 signed previous-window cases. No curated-abstract impact. Whitespace and the 3,092-module aggregate pass.
Author reports six local gates. At inspection, Lean CI and Comparator were running; Guide/title passed. No reviewer Lean build. The final NetworkFamily/encoding assembly remains separate. Live head rechecked before posting.
|
|
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 construction, step 3: the table twin, for #1833 (step 2 of the H3c handoff), by
worker-claude-e6cf7b0d-hpv-h3d(Claude Code, Opus).Stacked on #1900 (graph twin), which is stacked on #1897. Review only the last commit until those land.
The whole explicit block-counting network of a schedule number is now computed by arithmetic and certified in plain polynomial time. With #1900 this is the full content of the
polyTimefield of E1'sNetworkFamily, up to the final encoding, which the assembly PR adds against #1862'sencExplicitNetwork.What is proved (
Probabilistic/ExplicitBlockNetwork/Table.lean).decodeLetter e b ndecodes any natural number to a letter: a control record belowcontrolCount = (s+1) b^(k+1) 3, and otherwise block contents of(n - controlCount) mod 3^b. It invertsletterEquiv(decodeLetter_letterEquiv,decodeLetter_of_lt). On plain data,decodeControlDatareads the state, the offsets as base-bdigits and the output track by division and remainder (decodeControlData_controlEquiv), andcontentsCellNum/acceptNumgive block cells and the accepting weight (contents_decodeLetter,acceptWeight_decodeLetter).lastBeforeNum_eq: a search over the earlier intervals islastBefore.val_portOf: the window entry is a digit-count difference mod 3.card_intervalHolds: the tensor of an interval isintervalCountwhen its leaving letters are a control record and block contents, and zero otherwise (card_intervalHolds_eq_zero).blockNetwork_tensor_decodeLetter: at letters decoded from numbersL, every tensor of the block-counting network isoldEntryNum, which evaluateslocalIntervalCount(feat(machines): interval counts in polynomial time (#1833 H3) #1897) on decoded plain data, or the sink weight.letterCode_eq_iff,mem_range_letterCode_iff,invFun_letterCode: bits are a letter code exactly when the number they write is belowletterCount, and then they read the decoded letter.explicitTable_eq_explicitTableNumuses these and the subdivision and binarization tensors to give every table on numbers.explicitBlockNetwork_eq_explicitNetworkNum:explicitBlockNetwork machine input b (scheduleOfNat k q σ) e = explicitNetworkNum e b machine input q σ.length_explicitPortsNum_le: every vertex number has at most2 (3k+1) letterBitsports, including numbers past the vertices (explicitPortsNum_eq_nil).Certificate (
ExplicitBlockNetwork/TablePolyTime.lean).computableInPolyTime_explicitNetworkNum: for computed input bits,b,qin unary withb > 0,σin binary, and a computed unarycap ≥ 2 ^ b, the pair(numEdges, vertices)is polynomial-time intoencPair encUnary (encList (encPair (encList encNat) (encList encNat))), the components ofencExplicitNetwork. Tables have2 ^ ports ≤ cap ^ (2 (3k+1)(s+k+4))entries. The interval counts take their budget fromcap. Intermediate certificates for decoding, digit counts, windows, the interval tensor, validity and table entries are public.Small change to #1897's file.
ControlData.computableInPolyTime_mk(public) assembles a control record on plain data, becauseencControlDatais not exposed. It mirrorsIntervalData.computableInPolyTime_mk.Existing notions considered.
decodeLetteris the total extension ofletterEquiv.symm, needed because table indices are arbitrary bit strings;controlData(#1897) is reused as the target of decoding.lastBeforeNummirrors #1900'sfirstAfterNum. All definitions are numeric twins of #1872/#1877 constructions, proved equal to them; none replaces them.Limits. The
NetworkFamilyinstance and the conditional corollary are the next PR (assembly againstmain, which now has #1862 and #1868).Abstract impact. None.
Validation
scripts/check.sh --quick: falls back to all six gates (the stack includesreferences.bib); all pass locally.ComplexityTests/HPVExplicitTables.lean:34decodes to the control record of feat(machines): explicit Boolean block-counting networks (#1833 H3) #1877's test, and letter44to the block holdingtruetwice;emitCoin's explicit network, read throughexplicitBlockNetwork_eq_explicitNetworkNumanddecide +kernel: the interval's entry for the accepting halted record is2(both coin strings starting withtrue), the sink accepts letter1and rejects letter0, and a subdivision table is[1, 0, 0, 1];computableInPolyTime_explicitNetworkNum.Needs outside-fleet review (correctness and API). No new axioms; no
sorry; no heartbeat overrides.AI assistance
Written by Claude Code (Opus) as
worker-claude-e6cf7b0d-hpv-h3d, undercoordinator-claude-e6cf7b0d.🤖 Generated with Claude Code
https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG