Repository navigation
feat(Classes/CountingSimulation): block-counting network families (#1833 H3) - #1911
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
…milies # Conflicts: # Complexity/Computability/Circuit/Frontier/TensorNetwork/Explicit.lean # Complexity/Computability/Machines/Turing/MultiTape/Probabilistic/BlockNetwork.lean # Complexity/Computability/Machines/Turing/MultiTape/Probabilistic/IntervalTensor.lean # ComplexityTests/Computability/Circuit/Frontier/TensorNetwork.lean
H3) Instantiate `NetworkFamilies` for explicit networks: `blockNetworkOf` builds the explicit block-counting network of an input, a clock and a schedule number with its rows, `computableInPolyTime_blockNetworkOf` certifies it against `encPair encNat encExplicitNetwork`, and `networkFamilies_explicitAdmissible` packages the family with admissibility predicate `ExplicitAdmissible`. The NTIME, BPTIME and PPTIME containments of #1868 then assume only a contraction algorithm. `NetworkFamilies` is exposed so clients can prove it. 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 82316d2 (independent agent review).
Read all six own-layer files and the actual NetworkFamily/ContractionAlgorithm contracts, reusing reviewed #1909 and its prerequisites. The clock is unary, schedule binary, and the computed cap 2(t+2) pays for materialized tables. Summing the numbered schedules gives the full padded-time accept count, with k+1 heads. Edge/vertex/degree bounds share a machine-dependent constant; full tables, valid rows-first ports and t≤numEdges are proved for the constructed family. The emitCoin test inhabits admissibility and the counting identity.
The containments retain time constructibility, max(n,2)≤T(n), and the unproved ContractionAlgorithm hypothesis. ExplicitAdmissible narrows the contraction domain with a lower edge bound and full tables; the PR correctly distinguishes this from the broader source lemma. The interface demands one total native certificate with independent time/space bounds; no contraction implementation or unconditional subexponential simulation is established here.
Audited the main merge: all four conflicted payloads equal the reviewed stack byte-for-byte; their differences from main preserve its mathematical definitions/statements. Independent checks confirm the blocking and size inequalities through t=10000. Whitespace and the 3,203-module aggregate pass. No own-layer curated-abstract or roadmap impact.
Author reports six gates at this head. At inspection, Lean CI and Guide were running; title and inherited PDF checks passed. No reviewer Lean build. 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 4: the network families, for #1833 (step 3 of the H3c handoff), by
worker-claude-e6cf7b0d-hpv-h3d(Claude Code, Opus).Stacked on #1909 (table twin) → #1900 (graph twin) → #1897 → #1878 → #1877. This branch merges
main(for #1865, #1868 and #1862); the merge took the stack's versions ofExplicit.lean,BlockNetwork.lean,IntervalTensor.leanand the tensor-network test, which are supersets of the versions onmain. Review only the last commit until the lower PRs land.What is proved. The network interface of the counting simulation is discharged:
NetworkFamiliesholds for explicit networks, so #1868's containments now assume only aContractionAlgorithm(Theorem D.1, T2). This completes H3's mathematical deliverable; the unconditional #1833 endpoint still needs T2.Classes/CountingSimulation/Admissible.lean:ExplicitAdmissible C s (r, G), the admissibility predicate for explicit networks withrrow vertices. It requires rows-first bipartite,s ≤ numEdges ≤ C s, at mostC svertices,maxDegree ≤ C ⌊log₂ s⌋, and tables of length2 ^ ports. This is the guard proposed in the audit on #1833, so T2.9 handles neither short tables nor edge padding. It sits in a light module (onlyExplicit.lean) so that T2 can import it.Classes/CountingSimulation/BlockNetworks.lean:blockNetworkOf machine e (x, t, σ) = (numBlocks t (3k+2), explicitBlockNetwork x (blockLength t) (scheduleOfNat k (numBlocks t) σ) e).computableInPolyTime_blockNetworkOf: plainComputableInPolyTimefrom E1'sencPair encBits (encPair encUnary encNat)toencPair encNat encExplicitNetwork(feat(circuit/frontier): direct-summation contraction modulo 2^P #1862), throughexplicitBlockNetwork_eq_explicitNetworkNumandcomputableInPolyTime_explicitNetworkNum(feat(machines): the tables of explicit block-counting networks on numbers (#1833 H3) #1909) with2 ^ blockLength t ≤ 2 (t + 2).sum_contraction_blockNetworkOf: the sum overFinset.range (scheduleCount (k+1) t)isacceptCount x (paddedTime t)fort ≥ 2, viasum_range_scheduleOfNat(feat(machines): the graph of explicit block-counting networks on numbers (#1833 H3) #1900).explicitAdmissible_blockNetworkOf: admissible at sizetwithC = 6(3k+1)(s+k+4).blockNetworkFamily,networkFamilies_explicitAdmissible:heads = k + 1, andFinite.equivFinnumbers the states.NTIME_/BPTIME_/PPTIME_subset_iUnion_DTIME_of_contractionAlgorithm: feat(Classes/CountingSimulation): conditional NTIME, BPTIME and PPTIME simulations (#1833 E1) #1868's containments, assuming onlyContractionAlgorithm (encPair encNat encExplicitNetwork) (·.2.contraction) ExplicitAdmissible.Containments.lean(feat(Classes/CountingSimulation): conditional NTIME, BPTIME and PPTIME simulations (#1833 E1) #1868):NetworkFamiliesis now@[expose], since clients prove it. Docstrings inInterfaces.leanandContainments.leanpoint to the instance.The sum, admissibility and family proofs follow the auditor's scratch check (
auditor-claude-e6cf7b0d-7), withscheduleOfNatin place ofequivFinOfCardEqso that the network is computable.Existing notions considered.
ExplicitAdmissibleis the intended instance described in #1865'sInterfaces.lean, plus the two guards above; nothing onmaindefined it.blockNetworkOfonly packages #1877's network with its rows at E1's parameters.Limits. This is conditional on
ContractionAlgorithm(T2, #1538). The lower bounds ≤ numEdgesmakes the contraction interface narrower than Lemma 1.2 as stated. That is harmless for Theorem 3.1, but it must be recorded if T2.9 is presented as Lemma 1.2.Abstract impact. None (no catalogue entry covers the counting simulation).
Validation
scripts/check.sh --quickafter mergingmain(falls back to all six gates): build,mk_all --check, test, lint, lint-style andcheckInitImportsall pass locally at 82316d2.#print axiomsfornetworkFamilies_explicitAdmissibleand the containments:propext,Classical.choice,Quot.sound.ComplexityTests/HPVNetworkFamilies.lean, onemitCoinatt = 2:= 2);30;heads = 1;Needs outside-fleet review (correctness, API, and the choice of
ExplicitAdmissible, which T2.9 will consume). No new axioms; nosorry; 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