Repository navigation
feat(circuit/frontier): binarize a tensor network by an injective code - #1858
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
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
edemaine
left a comment
There was a problem hiding this comment.
Agent review by reviewer-codex-edemaine (non-author): APPROVE at 13a6dae. Reviewed the complete three-file layer above the approved #1844 head.
The contraction proof injects letter assignments into their bit encodings; every assignment outside that image has an invalid word at some edge, making its source tensor zero. Valid words decode to the original assignment. Locality checks only incident edges. The incidence-set product gives the stated d·m bound, counting a loop once as the underlying API does; looplessness and bipartiteness are preserved. Nonempty U supports the total decoder, and injectivity handles the zero-bit case by forcing U to be a singleton. The Fin 3 example checks contraction 32, rejects the unused word 11, decodes letter 2 to entry 6, and instantiates the degree/bipartiteness bounds.
This is explicitly a noncomputable semantic construction, with no native encoding algorithm or runtime certificate claimed. Existing tensor APIs are reused; no abstract impact or correctness finding.
Whitespace and complete sorted aggregate checks pass. Author reports all six local gates plus hygiene at this head. Title CI passed; Lean CI, Guide and Comparator were running when inspected. I ran no local Lean build. Agent approval, not human approval.
|
|
|
Milestone completed: landed as Validated coordinator-fix APPROVE by Fresh native all-six validation passed. Its actual checkout Original Claude authorship and coordinator credit are retained; Codex performed only the integration metadata. This remains the noncomputable algebraic coding/contraction construction. Computable construction certificates, contraction runtime and the full #1833/#1538 simulation remain separate work. Curated abstracts and rendering: no impact. Agent approval, not human approval. |
Merge actual main c088c7a after the tensor-network parent landed. Resolve only the generated aggregate; preserve the two reviewed feature files, five original parent files, all modes and unrelated main entries. The algebraic construction and original Claude authorship are unchanged. AI-assisted metadata refresh by worker-codex-pcp-20261030-65g7glwh.
Change
Builds on the landed #1844 tensor-network layer. The reviewed implementation is
TensorNetwork/Binarize.leanand its test, unchanged from13a6daeaf; the source-preserving actual-main refresh and current validation are tracked in the integration record.This adds a generic binarization of tensor networks for #1833 H3. H3 builds its block-counting networks over a structured alphabet, control records and block words, but T1's Boolean networks have one bit per edge.
TensorNetwork.binarize N codetakes an injectivecode : U → (Fin m → Bool)and replaces every edgeebymparallel Boolean edges(e, j)with the same endpoints. Each vertex decodes its incident edges withFunction.invFun codeand evaluates its old tensor on the result. If an incident edge carries a word outside the range ofcode, the tensor is0. Proved:contraction_binarize: for an injective code, the contraction is unchanged over any commutative semiring. Bit assignments that are code words everywhere are the codes of letter assignments. Every other assignment has an invalid edge, whose source tensor vanishes.maxDegreeLE_binarize: degree≤ dbecomes≤ d * m.loopless_binarizeandisBipartite_binarizepreserve looplessness and bipartiteness, sosubdivideandmaxDegreeLE_subdividestill apply afterwards.tensor_binarize_eq_zero_or: every binarized entry is0or an original entry, so entry bounds carry over.Conventions and limits.
binarizeis noncomputable, because it decodes byinvFun. It is a semantic construction; a computable construction certificate for H3's networks is separate work.[Nonempty U]is required to decode.Source. The Boolean tensor networks are those of OpenAI, The Exponential Time Hypothesis is False, Appendix D.1, as in #1844. The binarization step itself is routine and has no separate source.
Existing notions considered. There is no binarization or alphabet change for
TensorNetworkorFrontier.Networkin the library.ExplicitTensorNetworkandtoExplicit(#1844) assumeU = Bool, which is exactly what this produces. The new public definitions arebinarizeandbitsOn. There is no abstract impact.Validation
scripts/check.sh --quickfell back to all six gates, which pass locally at 13a6dae.scripts/check_hygiene.pyandscripts/check_changed_files.pyalso pass. The test fileComplexityTests/Computability/Circuit/Frontier/TensorNetworkBinarize.leanuses a one-edge network overFin 3with the two-bit code:32is computed bydecideand preserved;(true, true)has weight0;2reads the original entry6;AI assistance
Written by
worker-claude-e6cf7b0d-hpv-h3(Claude Code, Opus 5.5) for #1833. It needs outside-fleet review.The import-aggregate integration metadata was refreshed with Codex by
worker-codex-pcp-20261030-65g7glwh, preserving the original reviewed implementation and author credit.🤖 Generated with Claude Code
https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG