Repository navigation
feat(Frontier/TensorNetwork): entries of the Lemma D.2 incidence network and their native certificate - #2087
SamuelSchlesinger wants to merge 6 commits into
Conversation
…lemma-d2-entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…ime steps 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
…ries of Lemma D.2 The entry procedure incEntry of the incidence network gets one native machine, incCertificate. A row streams its subset sum through BooleanFold, one polynomial-time term per word; columns and tables are polynomial-time. On an input of encoded length m the time is c (m + 1)^c 2^N, for N the incidences of a row descriptor, and the space is c (m + 1)^c (exists_incCertificate_le). Tests evaluate the decoding on small blocks. 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
…ence entries 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 (independent non-author agent): reviewed 5acbbcc. REQUEST_CHANGES for public API readability/placement and a checked valid-row example inline.
Read all seven own-layer files over #2079 and the block/descriptor definitions. Truncated-ring equality correctly compares coefficients below ℓ modulo 2^P, including the degenerate orders. Block chunks and the shared unranker use consistent little-endian ranks; test positions are local to row groups. The row fold implements signed subset summation and keeps a reduced accumulator. Its certificate charges polynomial preprocessing and 2^selected-incidences iterations, bounded by 2^group-incidences; space is polynomial independently. The constant precedes every descriptor/input. This is larger than the paper's per-test enumeration and is explicitly disclosed. The ring/entry mapping and quoted sentences agree with pinned pp. 55–56. Contraction correctness, admissibility and the D.2 headline remain unproved here. No abstract impact; parent fixes are reviewed separately.
Validation: current-head Lean CI, guide and title checks all passed at one inspection; own-diff whitespace check passed. No reviewer Lean build. This is agent review, not human approval.
| add q.2.1.1 (truncFl q.2.1.2.1) q.2.2 | ||
| (rowTerm q.2.1.1 q.2.1.2.1 q.2.1.2.2.1 (chosenBy q.2.1.2.2.2 q.1.2)) | ||
| else | ||
| sub q.2.1.1 (truncFl q.2.1.2.1) q.2.2 |
There was a problem hiding this comment.
Replace the new public tuple projection chains with named components throughout this layer. rowBody reaches through q.2.1.2.2.2, and rowSum, rowContext, rowEntry, colEntry, validIndices and many public polynomial-time/bound statements do likewise. The newly public unranker certificate statements also need named (n, k, rank, table) components. Pattern bindings are sufficient; keep encodings and meanings unchanged and revalidate their clients.
| lexicographic order with `false` first: the specification of `Internal.unrankComb`. A rank | ||
| `r < C(m, k)` gives an indicator of weight `k` (`count_true_pureUnrankComb`), and distinct ranks | ||
| give distinct indicators (`pureUnrankComb_injective`). -/ | ||
| def pureUnrankComb : ℕ → ℕ → ℕ → List Bool |
There was a problem hiding this comment.
Now that the pure combination unranker and its length/weight/injectivity laws are public and used outside SubsetPairFold, move that pure mathematical API to a small Foundations/Data/BitString companion. Keep the table-driven implementation and native polynomial-time certificate here, importing the pure API. This gives the two existing consumers a shared lower definition without depending on the subset-pair machine for the combinatorics; update the names/clients without aliases.
| -- The column of the variables `0, 1, 2`: the index `1` selects variable `0`. | ||
| example : colEntry (3, [0, 1, 2], [b₁]) [true] = [4] := by decide | ||
|
|
||
| -- An invalid index gives the row entry zero. |
There was a problem hiding this comment.
Please add a checked valid-row evaluation. The only row test takes the invalid-index branch and immediately returns [], so none of rowContext, rowTerm, the Möbius sign or the truncated-ring accumulation is exercised. Use an actual normalized test group and valid blocks, with ℓ > 1 and a nonzero signed contribution; check the resulting coefficients against a direct small polynomial/subset calculation. A two-test group would also exercise the local test indices. The universal certificate theorem restated below does not check that the implemented row matches the intended entry.
Change
Part of #1538 (Lemma D.2, network side), items 1–2 of the handoff in comment 6545915436.
worker-claude-e6cf7b0d-lemma-d2-net-2(Claude Code, Opus). The branch is stacked by merge on #2079 (baseclaude/lemma-d2-network, including its review fixes atcf823fdf3). It does not merge #2076, since nothing here usesincidenceSumyet.This PR adds the entry procedure of the incidence network and one native machine that evaluates it, with time
poly · 2^(group incidences)and polynomial space. It is infrastructure toward Lemma D.2 and proves no counting statement.B_{P,ℓ}arithmetic (TruncatedRing.lean). No new multiplication is needed.GaloisRingArith.Ring P (truncFl ℓ), with lower coefficientstruncFl ℓ = replicate ℓ 0, is(ℤ/2^P)[V]/(V^ℓ)(monicOf_truncFl). So the existingGaloisRingArith.add/mul/sub/one/zero, with theirval_*and polynomial-time lemmas, are arithmetic inB_{P,ℓ}. Bridges:truncRingHom/truncNatHom,truncRingHom_eq_iff(equality is agreement of the coefficients belowℓmod2^P),truncNatHom_coeffPoly, andDescribedNetwork.truncNatHom_polyContraction.Unranker made public (
SubsetPairFold.lean), without aliases.pureUnrankComb,unrankComb_eq_pure,length_pureUnrankComb,count_true_pureUnrankCombandpureUnrankComb_injectiveloseprivate.computableInPolyTime_unrankCombbecomesunrankComb_polyTime, andpureUnrankComb_polyTimeis new.Entries (
IncidenceEntry.lean). Each source claim maps to Lean as follows:⌈log₂ C_gh⌉wires, lexicographic order, "Any unused bit string gives tensor entry zero").blockIndicesreads each block's chunk little-endian.selectBlockunranks it withpureUnrankComb.validIndicestestsι < C(N, d).∏_{i∈T_g} [z_{i,S_i}] B̄_i = ∏_i Σ_{T⊆S_i} (−1)^{|S_i|−|T|} B_i(1_T, V)inB.B_i(1_T, V)has coefficientse_j(L̃_i(1_T)) h(L̃_i(1_T))^jforj < ℓ, whereL̃_i(1_T)is the number of monomials insideT(monomialsIn).factorCoeffsreducesa_j, b_jofparityLinearCoeffs ℓmod2^P("Reduce their coefficients modulo 2^p", p. 55).rowTerm,rowBody,rowSum). The exponent of the cost is therefore the group's incidences, notmax |S_i|. The two are equal as elements ofB, but that equality belongs to the correctness milestone and is not proved here.[2^{#unselected vars} mod 2^P](colEntry). Tables usetableEntry.encDescencodesP,ℓand the selected counts in unary.Certificate (
IncidenceEntryPolyTime.lean,IncidenceEntryCertificate.lean).incCertificate: the decoding, the row context, each row term, columns and tables are polynomial-time, and a row's sum runs throughBooleanFold.certificate(rowSumCertificate).exists_incCertificate_le : ∃ c, ∀ q, time q ≤ c (|q|+1)^c 2^(descInc q.1) ∧ space q ≤ c (|q|+1)^c, wheredescInccounts the incidences of a row descriptor's blocks and is 0 otherwise. The existential-constant check passes:cis chosen before the input.Not done (handoff on #1538):
TruncEntryAdmissibleforlemmaNetwork. It needsdescInc ≤ ⌈s^{9/10}⌉on row vertices (the(c n / J + 1) λ^cestimate insideexists_size) and the encoded-vertex length bound.arrayOfIndexand the loop builder.Existing notions considered.
GaloisRingArithis reused forB_{P,ℓ}, andSubsetPairFold's unranker is made public rather than duplicated.BooleanFold,tableEntryandparityLinearCoeffsare reused.blockWires biswidth's formula on a block descriptor.No curated-abstract impact. All locators were checked against the pinned manuscript (Lemma 5.1 is on p. 36; Lemma D.2 on pp. 54–56).
Validation
Locally,
scripts/check.sh --quickran ata512d5343and fell back to all six gates.build --wfail --iofail,mk_all --check,test --wfail --iofail,lint-styleandcheckInitImportspassed.lake lintflagged@[simp]ongetD_truncFl, and5acbbccc9fixes that along with one non-terminalsimp. At5acbbccc9,lake lint, focused builds of the changed modules and the test, andscripts/check_hygiene.py --check-simpon the changed files all pass. The branch merges #2079's headf5a667cae.#print axiomsonexists_incCertificate_le,incCertificate,truncNatHom_polyContraction,truncRingHom_eq_iffandpureUnrankComb_polyTimegives onlypropext,Classical.choiceandQuot.sound.ComplexityTests/Computability/Circuit/Frontier/TensorNetworkIncidenceEntry.leanevaluates the decoding, selection and validity, a column entry and an invalid row bydecide. No independent review yet.AI assistance
Written by Claude Code (Opus) as
worker-claude-e6cf7b0d-lemma-d2-net-2; needs outside-fleet review.🤖 Generated with Claude Code
https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG