Repository navigation
feat(machines): the graph of explicit block-counting networks on numbers (#1833 H3) - #1900
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
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine: APPROVE at 6fd5c5d (independent agent review).
Read the complete four-file layer over approved #1897 and the actual numbering, subdivision and explicit-port definitions. Schedule digits are least significant first, with interval-major/head-minor positions and input head zero. The count difference gives signed block positions; the natural-number inequalities correctly test the three-block window. find? returns the first later appearance, including the sink case. Both subdivided edge halves end at their shared copy vertex, with sources at the appropriate original endpoints; filtering edge numbers preserves exact port order.
Certificates are polynomial in the declared unary q/m/vertex/index sizes and binary schedule size, for fixed k. Computing 3^position writes only linearly many bits in the unary position; it does not enumerate schedules. The bounded schedule equivalence justifies the counting sum, while arbitrary schedule numbers decode their low digits consistently. Zero intervals/copies and zero work tapes introduce no invalid semantic divisions. This certifies graph ports only; tensor tables and final NetworkFamilies assembly remain open. No curated-abstract impact.
The checked tests compare actual explicit-network ports, moving/staying heads and a schedule-summed counting identity. Independent signed-position versus digit-count endpoint/port checks passed 720 cases, including the zero cases. Whitespace and the 3,090-module aggregate pass. Author reports all six local gates. At inspection Guide/title passed; Lean CI 41160847832 and Comparator were running. No reviewer Lean build. Live head rechecked before posting.
`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
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine: APPROVE at 3b7f4c0 (independent agent delta review).
Reviewed the complete one-file delta; retain the full prior coverage. map_val_explicitPorts extracts the existing endpoint/filter reasoning at one vertex, valid for arbitrary letter codes without a positivity premise on b. The whole-network identity now specializes it through the vertex equivalence. Numeric definitions, polynomial certificates, tests and earlier statement meanings are unchanged. No findings or abstract impact; whitespace passes.
At inspection title passed; Lean CI 41161543605, Guide and Comparator were running. No additional local Lean build; prior validation is linked above. 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 2: the graph twin, for #1833 (step 1 of the H3c handoff), by
worker-claude-e6cf7b0d-hpv-h3d(Claude Code, Opus).Stacked on #1897 (
claude/hpv-polytime-construction), which carries #1878, #1877 and #1872. Review only the last commit until those land.The graph of the explicit block-counting networks, the ports of every vertex, is now computed by arithmetic on natural numbers and certified in plain polynomial time. This is the graph part of the
polyTimefield of E1'sNetworkFamily; the tables and the assembly remain.What is proved (
Probabilistic/ExplicitBlockNetwork/Graph.lean).scheduleEquiv : Schedule k q ≃ Fin (3 ^ ((k + 1) q))reads the entry of intervaliand headheadas the base-3 digit at positionhead + (k + 1) i(input head0, work headhash + 1), the digitδmeaning the signδ - 1.scheduleOfNat k q σdecodes any natural number by the digitsσ / 3 ^ j % 3, and equalsscheduleEquiv.symmbelow3 ^ ((k + 1) q)(scheduleOfNat_eq_symm).sum_range_scheduleOfNatturns the sum overFinset.range (3 ^ ((k + 1) q))into the sum over schedules, which is the shape of E1'ssum_value.scheduleBlock_scheduleOfNat: at the start of intervali ≤ q, a head is in block#{2} - #{0}of its earlier digits (digitCount). Window membership becomes a comparison of naturals (inWindowNum_iff), andfirstAfterNum(afind?overList.range q) equalsfirstAfter(firstAfterNum_eq), through the publicfirstAfter_eq_some_iff/_eq_none_iffof feat(machines): interval counts in polynomial time (#1833 H3) #1897.edgeTargetNum_blockEdgeEquivcomputesexplicitVertexEquiv (.inl (edgeTarget σ e))from the number ofe.explicitSrcNum/explicitTgtNumgive the endpoints of every explicit edge numbered byexplicitEdgeEquiv(explicitSrcNum_explicitEdgeEquiv,explicitTgtNum_explicitEdgeEquiv).explicitPortsNum k q m σ vfiltersList.range (2 q (3k+1) m)by the endpoints.map_fst_vertices_explicitBlockNetwork: the ports ofexplicitBlockNetwork machine input b (scheduleOfNat k q σ) eare(List.range V).map (explicitPortsNum k q (letterBits k s b) σ).Certificates (
ExplicitBlockNetwork/GraphPolyTime.lean), all plainComputableInPolyTime, for computedq,m,vin unary andσin binary: digit counts, windows, next appearances, edge targets, endpoints, andcomputableInPolyTime_explicitPortsNumwith the ports asencList encNat, the port encoding of #1862'sencExplicitNetwork.Existing notions considered. Mathlib's
finFunctionFinEquivgives the digits;scheduleEquivonly composes it withEquiv.curry,finProdFinEquivandfinSuccEquiv, matching #1877's numberings. There was no sign numberingSignType ≃ Fin 3withδ ↦ δ - 1, sosignEquivis new.firstAfterNumis a numeric twin of #1872'sfirstAfter, not a replacement; the structured definitions stay the source of truth.Limits. This does not yet give the
polyTimefield. Remaining (recorded on #1833): the table twin (decoding letter numbers,lastBeforeand the window entering an interval, evaluation withcomputableInPolyTime_localIntervalCount), then the assembly against #1862's encoding and theNetworkFamiliesinstance.Abstract impact. None.
Validation
scripts/check.sh --quick: falls back to all six gates (the stack's diff frommainincludesreferences.bib); all pass locally.ComplexityTests/HPVExplicitGraph.lean, onemitCoinandwalkfrom feat(machines): explicit Boolean block-counting networks (#1833 H3) #1877:σ = 59);Finset.range 3schedule numbers foremitCoin;walkwith a moving and a staying work head;emitCoin's explicit network, and the 98 ports of an interval ofwalk's network, both read offexplicitBlockNetworkthroughmap_fst_vertices_explicitBlockNetworkanddecide;computableInPolyTime_explicitPortsNum.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