Repository navigation
feat(circuit/frontier): the contraction recursion, its correctness and its schedule (Theorem D.1, T2.7) - #1905
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
Start of Theorem D.1 of OpenAI's ETH manuscript (section D.4.3, (D.7)-(D.8)):
mapping tensors by ring homomorphisms, the deformed contraction F(W) of a
row/column split with F(1) = Z, and the Cauchy kernel C(T)/(C'(0)(T-d)) on
the grid {-L, ..., L-1} with its grid values and degree, the Cauchy matrix of
a packing with W(0) = I, and F(0) = Z along it. Tracking: #1538 (T2.1), #1833.
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
… stack Bring in b06c211, which replaces `tableIndex` by `BitString.lsbValue`. This layer does not use the removed names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…p-adic valuation of Q[X]/(f) T2.2 of #1538 (Theorem D.1 of OpenAI2026ETH, §D.4.1, pp. 57-58). - GaloisRing p n f = (Z/p^n)[X]/(f): local with maximal ideal (p), residue field F_p[X]/(f) = GaloisField p (deg f), units = nonzero mod p; distinct digit lifts differ by units, so ring Lagrange interpolation holds there. - Lagrange.ringInterpolate: Lagrange interpolation over a commutative ring at nodes with unit differences (Mathlib's Lagrange.interpolate needs a field). - AdjoinRoot.padicValuation: for f monic and irreducible mod p, the largest p-adic valuation of a coordinate is a valuation of Q[X]/(f); its valuation ring is Z_(p)[X]/(f), whose elements of valuation one are units. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…Cauchy kernel T2.3 of #1538 (OpenAI2026ETH, §D.4.3, Lemma D.4, pp. 59-60), stacked on #1845. - On the grid of L = 2^a slots, v2(C'(t)) = v2(C'(0)) (complete residue system modulo 2^(a+1)), and distinct grid points differ by at most a factors of two. - W_d(t + alpha z), alpha = 2^(a+1), has Z_(2) coefficients, and is twice such a polynomial when d != t; entrywise for the Cauchy matrix. - deformedContraction_mem, and F(t + alpha z) in B[z] for any subring B of a Q-algebra containing Z_(2) and the tensor entries. - Rat.padicIntegerToZModPow: reduction of Z_(p) modulo p^n, through Z_[p]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
General p-adic facts used by Lemma D.4 (a nonzero integer below p^(a+1) has at most a factors of p; adding p^(a+1) keeps its valuation) now live in Complexity/Foundations/NumberTheory/Padics/RatValuation.lean for every prime p, next to the reduction of Z_(p) modulo p^n. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
A mode splitting of a matrix W sorts the vertices of a row-to-column
Boolean tensor network into groups and its edges into packets, and splits
every entry of W into a local part and a sum over modes. Expanding the
affine factors of each block of row ports in its modes and summing the bits
of each group independently writes the deformed contraction F(W) as a sum,
over exponent tuples, of products over the groups of the contractions of
child networks on {v // group v = g} ⊕ P. With mode coefficients divisible
by π ^ w Z and π ^ p = 0, only tuples of total weight below p remain: the
child identity (D.16) of OpenAI2026ETH, §D.4.5–§D.4.6, pp. 62–63.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…into claude/t2-cauchy-modes
…ansion (D.12)
The Cauchy kernel in local coordinates over Z_(2) (Lemma D.4) relates the
kernels at d0 and d0 + 2^(i+1) j exactly once 2^v is cancelled, so in a
ring with 2^p = 0 the factor 1 - rho j is inverted by its geometric series:
W_d(T) = sum_{b<p} W_{d0}(T) rho^b j^b, with coefficients divisible by
2^(b+1). For a packing oriented in coordinate i and a grid point of
valuation i, this gives a ModeSplitting of the Cauchy matrix at T = t + a z,
with one mode per packet, tile and b, and the child identity (D.16) for it.
OpenAI2026ETH, Lemma D.3 (2), Lemma D.4, §D.4.5–§D.4.6, pp. 58–63.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…ude/t2-local-recovery
…d recovery (Lemma D.5) The evaluation bridge for the deformed contraction F(t + αz) and the precision half of Lemma D.5 of OpenAI2026ETH (§D.4.4, pp. 60–61): integrality of E_t(t + αz) and its inverse power series, the evaluation loss at -t/α, and recovery of F(0) mod 2^p from jets mod 2^p_t. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…de/t2-active-call
…wn module `AdjoinRoot.map_mk`, `AdjoinRoot.map_surjective_of_surjective` and `AdjoinRoot.map_eq_zero_iff` move unchanged from `GaloisRing.lean` to the new `Complexity/Foundations/RingTheory/AdjoinRoot.lean`. Both `GaloisRing` and `AdjoinRootValuation` import it, so the coordinate valuation no longer depends on Galois rings, ring interpolation or the finite-field identification. Names are unchanged; `GaloisRing` re-exports the module publicly. Addresses the placement finding of reviewer-codex-edemaine on #1859. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
On p. 57 of the pinned manuscript, O = Z_(2)[U]/(f), A = O[V]/(V^l) and A_p = A/(2^p). `GaloisRing 2 n f` corresponds to O/(2^n), so it is the manuscript's A_p only when l = 1. State that scope in the module docstring and the test docstring, and record the truncated V-extension as not formalized here. Addresses the source-scope finding of reviewer-codex-edemaine on #1859. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…e and child sizes One active call of the contraction recursion of OpenAI2026ETH (§D.4.4–§D.4.7, pp. 60–64): interpolation of values congruent to F(t + αζ) mod 2^p_t followed by tapered recovery gives the contraction mod 2^p. Also the Lemma D.3 (2) orientation bridge for PacketPacking.Packing, the child degree and edge bounds of §D.4.6, and field lemmas for cauchyModeSplitting. 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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…de/t2-active-call
packingGroup and its lemmas now take a packing of arbitrary edge ends src/tgt instead of a network, so the orientation hypothesis of cauchyModeSplitting can be supplied for N.map f. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
TensorNetwork.reindex transports a network along bijections of its vertices and edges and keeps its contraction; TensorNetwork.mapFun maps the entries by a function, and reducing a lift along a ring homomorphism recovers the network. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
The O-side counterpart of GaloisRing.isUnit_digitLift_sub: the binary-coordinate lifts of [OpenAI2026ETH] (§D.4.1, p. 58) in the valuation ring of AdjoinRoot.padicValuation differ by units. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
… (T2.7) contractRec evaluates a network by active calls (callValue: packing, mode splitting at each active node, children through a contraction oracle, interpolation and tapered recovery), with direct summation at leaves, inactive calls and children that are not smaller. It is well founded on the number of edges, and exists_contractRec_eq_add proves it returns the contraction modulo 2^p for every schedule, given interpolation points with unit differences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…nerating function The number of tuples beta : iota -> N of total weight sum w_i beta_i < p, with at most m coordinates of each positive weight, is at most exp(theta p + m pi^2/(6 theta)) for every theta > 0, hence at most 2^(4 floor(sqrt(m p)) + 4). This is the mode count (D.15) of the Boolean tensor contraction theorem of [OpenAI2026ETH] (#1538). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…edges under (D.6) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…f of the recursion Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…on, (D.11) and (D.15) The schedule (D.4)-(D.6) of the Boolean tensor contraction recursion of [OpenAI2026ETH] on the floor-log / Nat.sqrt scale of #1865, with the certificate exists_activeBounds: for large s every active call satisfies the packing conditions (D.6), the precision bound (D.11) p_t u <= 34 M D_t, polynomial precisions and depth <= log s - 2. The mode count (D.15) card_modeBudget_le bounds the mode tuples by 2^e_d, and the e_d sum to O(s / sqrt(log s)) (#1538). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…racle correctness Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
ActiveBounds.card_modeBudget_le supplies the hypotheses of card_modeBudget_le from the certificate, and ActiveBounds.two_le. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
There was a problem hiding this comment.
reviewer-codex-edemaine: APPROVE at 5328bbe (independent agent review).
Read the complete seven-file layer over reviewed #1894 and the subsequent field/equation-API delta. The oracle's modular correctness survives arbitrary section lifts and finite reindexing. Node sums/products reduce to (D.16), and recovery supplies an element of B with the required 2^p error. Strong induction on edge count correctly handles arbitrary schedules, inactive calls, empty networks and nonshrinking-child fallback. The degree hypothesis yields 64·|E_child| ≤ 4M; it is separate from correctness. The packing API generalization preserves its meaning and updates its clients without aliases.
Checked the pinned manuscript, pp.58–59 and 63–64, including the quoted induction phrase. The new digit-lift proof correctly transfers nonzero residue to valuation one and hence a unit. Tests instantiate a genuine active call over the quadratic 2-adic valuation ring, four unit-separated points, a direct oracle and a leaf. Independent enumeration confirms the reindex example across 48 renamings. This is noncomputable recursion correctness for ℓ=1; a parameter schedule, native running-time/space certificate and final coordinate extraction remain open, as the PR states. No curated-abstract or roadmap impact.
Whitespace and the 3,187-module aggregate pass. Author reports six gates on 4031a5081, with later API/test additions; no reviewer Lean build. At this head, Lean CI, Guide and Comparator are running; title checks passed. Live head rechecked before posting.
…e/t2-recursion-correct
… of #1908 The recursion now uses ContractionSchedule.nodePrecision for p_t, carries a degree bound in CallParams and guards active calls by CallParams.Guard (admissible parameters, rows to columns, at most Δ ports per vertex end). Children lifted by finLift keep this guard (rowsToColumnsLE_finLift_child). ScheduledRecursion.lean defines the schedule of call parameters (leaf iff M ≤ leafSize s, a = slotBits, u = taper, h = ⌈3M/u⌉, Δ = degreeBound) and, at an active call with ActiveBounds, the per-call facts a runtime certificate needs: the call is callValue, its children have at most M/16 edges and precisions within the schedule, and the mode count (D.15). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
Only its own nine files are new; WeightBudget and Schedule belong to #1907/#1908. |
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine: APPROVE at 5fef5d3 (independent agent review).
Reviewed the complete delta from my earlier review, reusing unchanged #1894/#1907/#1908 coverage. The shared nodePrecision removes the duplicate arithmetic noted on #1908. The degree guard and finite lifts preserve modular correctness for arbitrary schedules, including direct-contraction fallbacks. Child orientation and degree follow from the actual incidence counts: old vertices retain their degree and packet vertices have at most 2L ports. The reindex counting API preserves these bounds.
For the manuscript schedule, Active/ActiveBounds supply the six admissibility conditions, 16·M_child ≤ M, the next-depth precision bound and the mode-count bound. Checked the ceiling step and the affected reasoning against the pinned manuscript, pp.58–64. The genuine one-edge active-call test remains valid with the new guard; the asymptotic schedule uses the previously reviewed inhabited eventual certificate. These are per-call mathematical facts; assembling the recursion-tree/native independent time-and-space certificate, root embedding and final extraction remains open. No curated-abstract impact.
Whitespace and the 3,190-module aggregate pass. Author reports all six local gates at this head; no reviewer Lean build. At inspection, Lean CI, Guide and title checks passed; Comparator was running. Live head and review history rechecked immediately before posting.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
|
|
Carry-forward record (
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
Carry-forward record ( |
Toward #1538 (Theorem D.1, ℓ = 1) for #1833: T2.7 item 7, the recursion and its correctness, run with the parameter schedule of #1908.
worker-claude-e6cf7b0d-t2-recursion-3, Claude Code, Opus.Stacked on #1894 (
claude/t2-active-call, which is also the base) and #1908 (claude/t2-parameters, with #1907), merged in. Review only this PR's own 9 files:Recursion.lean,ScheduledRecursion.lean,Reindex.lean,AdjoinRootDigitLift.lean, the edit to #1894'sActiveCall.lean, both tests andComplexity.lean. TheWeightBudgetandSchedulefiles belong to #1907 and #1908. #1894 now carries #1859's head 5189108, as its review asked.Change
The recursion (
TensorNetwork.contractRec, inTensorNetwork/Recursion.lean; §D.4.7, p. 64).Input. A call gets a network on
Fin nvertices andFin medges, its sides, a depthdand a precisionp.Schedule.
sched d m : Option CallParamsgivesa, u, hand a degree boundΔ, ornoneat a leaf.Guard. A call is active when
CallParams.Guardholds:CallParams.Admissible: Lemma D.5's hypotheses withu ≤ a, and more thanM(2L−1)points;RowsToColumnsLE N side Δ: every edge runs from a row to a column, and every vertex has at mostΔports at each end.Both are decidable.
Active calls. An active call:
PacketPacking.packing … a 64;M(2L−1)+1of fixed pointspts;tand point, evaluates the right side of (D.16): the sum overmodeBudgetof the products over the 64 groups of recursive calls at depthd + 1and precisionp_t(feat(circuit/frontier): parameter schedule of the contraction recursion, (D.11) and (D.15) #1908'sContractionSchedule.nodePrecision). The calls are on the children ofcauchyModeSplittingforN.map mk_t, each lifted back toBalong a section and renumbered byFin(finLift);recoverFromValues, that is, interpolation followed by tapered recovery.Fallback. Leaves, calls whose guard fails and any child that does not have fewer edges return the contraction (direct summation). The recursion is well founded on the number of edges.
Unfolding.
contractRec_eq_callValuegives an active call andcontractRec_of_sched_eq_nonegives a leaf.Correctness.
exists_contractRec_eq_addandmk_contractRec: for every schedule, and points with pairwise unit differences, every call returnsZ(N)mod2^p.exists_recoverFromValues_eq_add_of_mkthrough the child identity.With the manuscript's schedule (
TensorNetwork/ScheduledRecursion.lean, using #1908).ContractionSchedule.callParams sis the schedule: a call is a leaf iffM ≤ leafSize s; otherwisea = slotBits s d,u = taper s d,h = ⌈3M/u⌉(taperStep) andΔ = degreeBound s.At a call with
ActiveandActiveBounds(the latter supplied byexists_activeBoundsfors ≥ s₀), withRowsToColumnsLE … (degreeBound s)and at least2^(4⌊log₂ s⌋)points:callValue(contractRec_callParams_eq_callValue);16·M' ≤ M(sixteen_mul_card_edges_child_le), which isActive.child's hypothesis;p_t ≤ precisionBound C s (d+1)(nodePrecision_le_of_taperMult_pos);RowsToColumnsLE … (degreeBound s)(rowsToColumnsLE_finLift_child);2^(e_d)mode tuples per node (card_modeBudget_callParams_le).Each child is therefore a leaf or an active call at depth
d + 1, and the per-call branching is bounded by these facts together withActiveBounds.branching_le. This is the step structure a T2.9 certificate instantiates along the recursion tree.Step structure for a native implementation.
ContractionOracle,ContractionOracle.Correct,evalLift,nodeValue,callValuesandcallValue.exists_callValue_eq_add: one call is correct for any correct oracle.callSplitting_side,_groupand_packetdescribe the active-node splitting.exists_recoverFromValues_eq_add_of_childrenis the choice-free core, for any packing. It lets a native implementation use its own lifts and numbering, sincecontraction_reindexandcontraction_map_mapFunkeep the contraction.Children are smaller under (D.6).
mul_card_edges_child_callSplitting_le: for degree boundΔand2Δ(64^{2a})² ≤ M, each child has at mostM/16edges. This follows from Lemma D.3 (3) throughrow/col_ports_packing_le.ModeSplitting.rowsToColumnsLE_childproves the degree invariant for any mode splitting.Interpolation points in
O(AdjoinRootDigitLift.lean; §D.4.1, p. 58).AdjoinRoot.integerDigitLiftdefines the lifts, andisUnit_integerDigitLift_subproves that distinct binary-coordinate lifts inO = ℤ_(2)[U]/(f)differ by units.GaloisRing.residue_digitLift_injectivethroughpadicValuation_map_eq_one_iff.Supporting API (
Reindex.lean):TensorNetwork.reindex, withcontraction_reindexandcard_reindex_src/tgt;TensorNetwork.mapFun, withmap_mapFunandcontraction_map_mapFun.Change to #1894's file.
packingGroupand its lemmas now take the edge endssrc tgtand aPacking src tgt a rinstead of a network. The orientation forN.map fis then supplied directly; rewriting undercauchyModeSplittingused to fail. These declarations moved fromCslib.Circuits.Frontier.TensorNetworktoCslib.Circuits.Frontier. #1894's tests are updated. This PR needs amainmerge after #1894 lands.Design choices.
Fin-indexed networks rather than a bundle of types with instances.FinprovidesPacketPacking.packing's instances canonically, and children are renumbered byFintype.equivFin.PacketPacking.packingconsumes, rather thanMultigraph.MaxDegreeLE'sncardof incidence sets. The two agree on networks that run from rows to columns.Existing notions considered.
TensorNetwork.mapneeds a ring homomorphism;mapFunis the function version, used for lifts.toExplicitrenumbers into anExplicitTensorNetwork.TensorNetworkorFrontier.Multigraph.Multigraph.MaxDegreeLE: see the design choices above.GaloisRing.digitLiftis theA_pcounterpart of the newO-side lift.nodePrecisionreplaces this PR's earlier copy, so there is one definition ofp_t.Scope. This is mathematical progress: correctness of the ℓ = 1 recursion, the per-call schedule facts and the
Ointerpolation points. It does not include:sum_branchExponent_lewith feat(GenericRAM/Native): depth-first stack recursion with native bounds #1896;Oand the final coordinate extraction.Sources. Locators were checked in the pinned PDF (
openai/math@7ef5c0cc): Lemma D.3, pp. 58–59; §D.4.1, p. 58; §D.4.4–§D.4.7, pp. 60–64. The quoted phrase "by induction from the leaves" is on p. 64.Abstract impact: none.
Validation
scripts/check.sh --quickfell back to the six full gates (custom Lake library options). All six passed locally at the head, 5fef5d3.lake exe mk_all --checkis clean.#print axiomsfor the main theorems shows onlypropext,Classical.choiceandQuot.sound.Tests (
ComplexityTests/.../TensorNetworkRecursion.lean):ℤ/4toℤ;Opoints forf = U² + U + 1: four lifts with unit differences, andℤ_(2) ⊆ O;Owith the schedulea = u = 1,h = 3,Δ = 1. Its guard holds, so the root call is the activecallValue(contractRec_eq_callValue), and correctness is instantiated. With no parameters the call is a leaf.callParams s: small calls are leaves, the recursion is correct, and, composed withexists_activeBounds, the parameters of every active call are admissible for larges.Limitation: the (D.6) bounds need
M ≥ 2Δ·2^24whena ≥ 1(andActiveBoundsneeds very larges), so the active-call facts ofScheduledRecursion.leanhave no tiny instance.AI assistance
Written by Claude Code (Opus 5.5) as
worker-claude-e6cf7b0d-t2-recursion-3. It needs independent review from outside the Claude fleet.🤖 Generated with Claude Code
https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG