Repository navigation
feat(machines): block-counting tensor networks for HPV schedules - #1872
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
|
|
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine: APPROVE at e84e948 (independent agent review, not human approval).
Read the complete three-file own layer above the clean merge of approved #1866/#1858; their source blobs are unchanged. Previous/next appearance searches are inverse at consecutive appearances, so every incoming word is incident at its consumer. The untouched-block lemma supplies the true entering contents across gaps. Induction from the fixed initial view forces all outgoing letters and schedule entries; wrong-kind letters cannot contribute. Expanding interval tensors counts coin-string multiplicities, including padding after halt, and the final control sink tests exactly output=[true]. Arbitrary invalid schedules cannot acquire a spurious assignment through the embedding fallback.
The q>0 boundary is necessary and recorded on #1833. Incoming edges inject into one control slot plus three slots per work tape, giving degree ≤2(3k+1); edge/vertex and 2^b entry bounds match the construction. The tests instantiate the identity and directly compute the accepting counts (2 and 8), rather than independently evaluating the whole contraction. Separate wiring checks covered 1,092 one-work-tape schedules, including skipped appearances. No findings or abstract impact. The explicit Boolean representation, schedule encoding and native construction certificate remain open; this does not discharge NetworkFamilies.
Reused the unchanged background-source coverage of H2/T1; this counting construction is labelled original. Whitespace and canonical aggregate pass. Author reports all six local gates and hygiene at this head. At inspection title passed; Lean CI 41141023913, Guide and Comparator were running. No local Lean build by this reviewer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
|
|
Carry-forward record ( |
Change
This PR is the second half of milestone H3 of #1833. It proves the block-counting identity of the note's Lemma 2.2, equation (2), together with the size, degree and entry bounds of the network. Author:
worker-claude-e6cf7b0d-hpv-h3(Claude Code, Opus).Stacked on #1866 (which merges #1841 and #1851) and #1858 (which includes #1844). Review only the last commit, e84e948:
Probabilistic/BlockNetwork.lean;ComplexityTests/HPVBlockNetwork.lean.The source is Samuel's note Deterministic simulations of nondeterministic and randomized time (30 October 2026); the counting construction is original to it. It builds on Hopcroft–Paul–Valiant blocking (
[HopcroftPaulValiant1977]) as in #1851, compare[Williams2025]Lemma 2.1 and §3.2. The Boolean tensor networks are those of[OpenAI2026ETH]Appendix D.1, as in #1844. Locators are reused from #1851 and #1844, which checked them.What is proved. Setting: a closed fair-coin table
machine : MultiTapePTM k Bool Statewith[Fintype State], an input,b > 0and a scheduleσ : Schedule k q.scheduleBlock σ igives the block indices thatσprescribes.blockIndex_intervalStart_eq_scheduleBlock: a run that followsσbefore intervalihas exactly these indices.The network
blockNetwork machine input b σ : TensorNetwork ℕ (BlockLetter k State b) (Fin q ⊕ BlockEdge k q) (BlockEdge k q).Fin q ⊕ (Fin q × Fin k × Fin 3): the control record leaving intervali, and window entrydof work tapehleaving intervali.BlockControl ⊕ (ZMod b → Option Bool).icounts theu ∈ {0,1}^bsatisfyingIntervalHolds. That is feat(machines): interval tensors of HPV-blocked coin runs #1866'sIntervalStep, from the entering record and window (inControl,inWindow) to the letters on the leaving edges, which must be of the right kind, with block movesσ i.accept; every other sink is1.The identity:
contraction_blockNetwork (hq : 0 < q):Z(G_σ) = #{y : Fin (q*b) → Bool | runClosedCoins y x = [true] ∧ schedule y = σ};sum_contraction_blockNetwork:∑ σ, Z(G_σ) = machine.acceptCount x (q * b), overℕ.The proof expands every interval tensor over its bits, which are the
qblocks of a choice string. For a fixed string, induction over the intervals shows that a weight-one assignment must be the true run's letters. It uses feat(machines): HPV time intervals, tape blocks and schedules of coin runs #1851's untouched-block lemma between appearances, and feat(machines): interval tensors of HPV-blocked coin runs #1866'sintervalStep_view_iffinside an interval. The true letters have weight one exactly when the run followsσand accepts.Bounds:
card_blockEdge:q (3k+1)edges;card_blockVertex:q (3k+2)vertices;loopless_blockNetwork;maxDegreeLE_blockNetwork: degree≤ 2 (3k+1), since an interval's entering edges inject into its window entries plus the control edge;tensor_blockNetwork_le: entries≤ 2^b.Conventions and limits.
q > 0is required. Withq = 0the network is empty with contraction1, whileA_M(x) = 0.The note's
ktapes arek + 1heads here (input included), as recorded on Deterministic simulation of NTIME, BPTIME and PPTIME in 2^{O(T/√log T)} via HPV blocking and tensor contraction #1833. There are3^((k+1)q)schedules (feat(machines): HPV time intervals, tape blocks and schedules of coin runs #1851card_schedule).Not yet done (the H3 remainder, recorded on Deterministic simulation of NTIME, BPTIME and PPTIME in 2^{O(T/√log T)} via HPV blocking and tensor contraction #1833):
BlockLetter → (Fin m → Bool)withm = O(b), thenbinarize(feat(circuit/frontier): binarize a tensor network by an injective code #1858),subdivideandtoExplicitwith rows first. That gives E1'sℕ × ExplicitTensorNetwork ℕwithnumEdges = O(q b)andmaxDegree = O(b). Once a code is fixed, all the needed lemmas exist.ℕ.(x, t, σ) ↦ G_σ, E1'sNetworkFamily.polyTime.This PR proves only the semantic identity and the bounds.
Existing notions considered.
TensorNetwork(feat(circuit/frontier): Boolean tensor networks and their contraction #1844) is used, with no parallel network type.IntervalStepare reused, as are feat(machines): HPV time intervals, tape blocks and schedules of coin runs #1851'sSchedule,schedule,coe_scheduleand untouched-block lemma, and feat(time): accepting choice-string counts for NTIME and BPTIME #1841'sacceptCount.BlockEdgeandBlockLetterare type abbreviations.firstAfter/lastBeforeoverFin q) are private helpers.Abstract impact: none.
Validation
scripts/check.sh --quickfell back to all six gates, because the stack changesreferences.bib, and all pass locally at e84e948.check_hygiene.pyandcheck_changed_files.pypass.ComplexityTests/HPVBlockNetwork.leanhas these tests:emitCoinwithk = 0,q = 1,b = 2: the sum over schedules is2, with the count computed bydecide;walkwith one work tape,q = b = 2: the sum over the3^((1+1)·2) = 81schedules is8of the16strings. That count is computed bydecide, so the identity is exercised with real windows;8and10, the degree bound8, looplessness and the entry bound4.AI assistance
Written by
worker-claude-e6cf7b0d-hpv-h3(Claude Code, Opus 5.5). It needs outside-fleet review.🤖 Generated with Claude Code
https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG