Skip to content

Formalize Appendix D: recursive tensor contraction and the sharper Theorem 1.1 bound for #k-SAT #1538

Open

Description

@SamuelSchlesinger

Opened by coordinator-claude-c4b0c164-20261023 at Samuel's request. This is a follow-up to #1226, which is complete. Status: available.

Goal. Formalize the manuscript's sharper bound, Theorem 1.1, which Appendix D proves by recursive Boolean tensor contraction:

  • #F in (n+m)^{O_k(1)} · 2^{O_k(n log log n / √log n)};
  • 2^{O_{k,D}(n / √log n)} when m ≤ Dn.

Today CountingNativeEndpoint proves the §6.4 bound ρ(n) = n (log log n)² / √log n.

Content (manuscript revised 25 October 2026; check every locator against the pinned openai/math commit before citing, per #1072):

  • Theorem D.1 (Boolean tensor contraction). The network is a bipartite multigraph with one bit per edge. It has at most Cs edges and maximum degree at most ⌈s^{9/10}⌉. Its entries lie in (ℤ/2^{P₀})[V]/(V^ℓ). Contraction takes (s+L)^{O(1)} 2^{O(s/√log s)} time and polynomial space.
  • D.2 (fixed density): clause tensors plus equality trees, much like our frontier compiler's junction chains (Generalize the #1226 counter: arbitrary constraint languages, circuits over any signature, Boolean tensor networks #1326).
  • D.3 (arbitrary density): built on the §5–6 parity tests, which are already merged.
  • D.4 (the proof): Cauchy deformation of the wire identifications, tapered Hermite recovery driven by 2-adic valuations, mode counting, and a recursion over wires with polynomial space.

Reuse.

Endpoint. Prove the sharper rate natively, upgrade the catalogue abstract "OpenAI: the Exponential Time Hypothesis is false" so it states Theorem 1.1, and restate satExponent, ¬ETH and ¬SETH with the stronger counter.

Process.

Activity

  1. SamuelSchlesinger commented on Oct 30, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Scope note (coordinator-claude-e6cf7b0d, Samuel's decision 2026-10-30): #1326's optional M5, counting over general tensor networks, is folded into this issue. #1326 is closed. Cover it in this issue's M0 design together with the sharper #k-SAT bound.

  2. SamuelSchlesinger commented on Oct 30, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    M0 design: Theorem D.1 (Boolean tensor contraction), first for ℓ = 1 (worker-claude-e6cf7b0d-hpv-tensor, Claude Code, Opus). I claim the ℓ = 1 contraction theorem for #1833. The general-ℓ statement and the sharper #k-SAT bound stay open here, and this design is meant to extend to them.

    Source: the manuscript at the pinned revision openai/math@7ef5c0cc (OpenAI2026ETH). I checked every locator below in that PDF.

    What the source proves and what Lean already has

    Theorem D.1 (§D.1, p. 53).

    • Network. A bipartite Boolean tensor network with at most Cs edges and maximum degree at most ⌈s^{9/10}⌉. It has polynomially many vertices, and description length L.
    • Entries. In (ℤ/2^{P₀})[V]/(V^ℓ) with 1 ≤ P₀, ℓ ≤ Cs. Each entry is computable in time (s+L)^b 2^{A s^{9/10}} and space (s+L)^b.
    • Conclusion. The contraction is computable in (s+L)^{O(1)} 2^{O(s/√log s)} bit operations and (s+L)^{O(1)} space.

    The proof is §D.4, pp. 57–64.

    The openai/math Lean development does not contain Theorem D.1. lean/docs/378.md at the pinned commit scopes the Lean proof to the n (log log n)² / √log n rate. It names the sharper Theorem 1.1 bound as the manuscript's alone. I found no Appendix D material in lean/OAI/Algorithms/SubexponentialSAT/, so this port has no Lean guide. The math will be original formalization work, following the manuscript.

    T1 (#1833) supplies the network layer, on branch claude/boolean-tensor-networks:

    • Cslib.Circuits.Frontier.TensorNetwork, the weighted form of the frontier constraint network on the same Frontier.Multigraph, with its contraction;
    • subdivision by equality tensors;
    • bipartiteness;
    • explicit tables (ExplicitTensorNetwork) and the write-out theorem;
    • the 0–1 bridge from Frontier.Network.

    This answers the #950 reconciliation asked for when #1326's M5 was folded in. A #CSP or Boolean network in D.2 form is a TensorNetwork of indicator and equality tensors. The circuit compiler networks are 0–1 instances.

    Proof structure, mapped to milestones

    Each milestone is a PR of at most about 1.5k lines with a concrete test. Statements use plain computability.

    1. T2.1: deformed contraction (§D.4.3, (D.7)–(D.8), p. 59).
      • Split the vertices by side. Give each edge a row bit Y_e and a column bit X_e.
      • For any port-identification matrix W, define F(W) = ∑_{X,Y} A(Y) B(X) ∏_e l_{Y_e}((W X)_e), and prove F(1) = Z.
      • Define the Cauchy kernel W_{xy}(T) = C(T) / (C'(0)(T − (y − x))) on the grid S = {−L, …, L−1}. Prove that W(0) = I and that W(t) is supported on y − x = t.
      • This is pure algebra over a commutative ring and ℚ[T]. Started: see below.
    2. T2.2: the coefficient ring (§D.4.1, pp. 57–58).
      • O = ℤ_(2)[U]/(f), with f monic of degree e = 4⌈log s⌉ and irreducible mod 2, and A_p = O/2^p, a Galois ring.
      • Elements that are nonzero mod 2 are units, and v₂(xy) = v₂(x) + v₂(y) on K = ℚ[U]/(f).
      • The 2^e binary-coordinate lifts of residue-field elements have unit differences, so Lagrange interpolation holds over A_p.
      • A deterministic search finds f.
      • Mathlib has GaloisField, AdjoinRoot, IsLocalRing and Polynomial.Irreducible. Only the 2-adic valuation on K and the lift arguments are new.
    3. T2.3: Lemma D.4, integral local coordinates (p. 59).
      • W(t + αz) has entries in O[z], where α = 2^{a+1} and S is a complete residue system mod 2^{a+1}.
      • So F(t + αz) ∈ A[z].
    4. T2.4: Lemma D.5, tapered Hermite recovery (pp. 60–61, (D.9)–(D.10)).
      • Recover F(0) mod 2^p from truncated jets of F(t + αz) mod 2^{p_t}, with node multiplicities q_t = h·max(0, u − v₂(t)) that vary from node to node.
      • Prove the valuation estimate v₂(E_t(0)) ≥ −6Dh.
      • Reuse: Port OpenAI's ETH refutation (subexponential #k-SAT) natively into complexitylib #1226's Foundations/Data/Polynomial/HermiteInterpolation.lean (Polynomial.taylorJet, eq_zero_of_taylorJet_eq_zero, eval_zero_eq_of_taylorJet) handles a uniform multiplicity J. The tapered case needs the CRT form (D.9) with variable q_t. I propose generalizing that file to multiplicities J : Fin Q → ℕ instead of adding a parallel interpolation API.
    5. T2.5: Lemma D.3, packing into packets (pp. 58–59).
      • Derandomized labels in [r]^a by conditional expectations, and packets of L slots, with properties (1)–(3).
      • This is a self-contained combinatorial lemma with a polynomial-time construction.
    6. T2.6: modes and the child identity (§D.4.5–D.4.6, (D.12)–(D.16), pp. 62–64).
      • Expand the crossing terms geometrically. Bound the coefficient of a mode monomial by 2^{∑ w_Z β_Z}.
      • Prove the exact factorization F(t + αζ) ≡ ∑_β ∏_g Z_{g,β} (mod 2^{p_t}) over child networks.
      • Bound children by < M/8 edges and degree by ≤ Δ. Count tuples as in (D.15).
      • The children are TensorNetworks on {v // group v = g} ⊕ Packet, so they stay in T1's type.
    7. T2.7: the recursion, its parameters and correctness (§D.4.2 (D.4)–(D.6), §D.4.4 (D.11), §D.4.7 p. 64).
      • Fix the parameter schedule u_d, a_d, L, D_arr, H.
      • Prove the precision bound (D.11), and correctness by induction from the leaves.
      • Count calls: exp(O(s/√λ)) in total.
    8. T2.8: the native algorithm.
      • A depth-first implementation with an explicit stack.
      • Certify time (s+L)^{O(1)} 2^{O(s/√log s)} and polynomial space (see below).
    9. T2.9: the interface for Deterministic simulation of NTIME, BPTIME and PPTIME in 2^{O(T/√log T)} via HPV blocking and tensor contraction #1833. This is the note's Lemma 1.2, with the explicit contract below. It also covers the finite range of small s, by direct summation.

    T2.2–T2.5 are independent of each other and can run in parallel with T2.1. T2.6 needs T2.1, T2.3 and T2.5. T2.7 needs everything before it.

    Proposed input contract (T2.9, consumed by E1)

    • Input. (P, r, d) with d : ExplicitTensorNetwork ℕ. Its rows are vertices 0, …, r−1 and its columns the rest.

    • Output. d.contraction % 2 ^ P, correct on every input. Over ℕ this is the ZMod (2^P) contraction of the residues.

    • Space. At most K (|input| + 1)^K on every input. The fallback is direct summation, which is already polynomial-space.

    • Time. At most K (|input|+1)^K 2^{K m / √log m}, where m = max(d.numEdges, 2), on inputs that meet a decidable guard:

      • every edge has exactly one row port and one column port;
      • d.maxDegree ≤ ⌈m^{9/10}⌉;
      • P ≤ C m;
      • every table has length 2^{deg}.

      K depends only on C.

    • Producer. TensorNetwork.subdivide followed by toExplicit gives this rows-first form. The bipartition is part of the input, so the algorithm never has to 2-colour.

    The note's Lemma 1.2 (degree O(log s), P = O(s)) is then a corollary, for all large s and by direct summation below that.

    How runtime is certified (as in #1226)

    #1226 certified its native subexponential bound with GenericRAM.NativeCertificate (Computability/GenericRAM/Native/Certificate.lean): a finite multi-tape machine within input-dependent time and workspace bounds. These are composed through Native/Combinators.lean (prod, branch, post, clocked iterate), the streaming folds IndexFold and BooleanFold, and ExhaustiveCountFallback, the guard-plus-exhaustive fallback that absorbs small instances. T2 uses the same layer:

    • Leaves and small s: BooleanFold over 2^{#edges} assignments with a streaming product of table lookups. This is the first native PR, and it is also the fallback in the input contract.
    • Galois-ring arithmetic mod 2^p in the basis 1, U, …, U^{e−1}: polynomial-time certificates from the existing PolyTime.Nat.Binary primitives.
    • The recursion: an explicit stack of frames, each holding a call's packets, interpolation node and value, mode tuple and partial sums, run by NativeCertificate.iterate. Per step the time is polynomial. The step count is the number of calls times a polynomial, which is exp(O(s/√λ)) by T2.7. The space is the stack depth O(log λ) times a polynomial frame.
    • Enumerating mode tuples with polynomial delay (§D.4.5, p. 63): a mixed-radix successor under the weight budget, reusing the IndexFold pattern.

    As in CountingNativeEndpoint, the endpoint fixes the machine and all constants before the input is given.

    Existing notions considered

    • Frontier.Network and Frontier.Multigraph: reused (T1).
    • Cslib.Multigraph, given by ends : E → Sym2 V: not used. Subdivision needs the two named ends that Frontier.Multigraph provides.
    • Logic.PL.CSP: a CSP is a factor graph whose variables may occur in many constraints. A tensor network is the case where every variable has exactly two ports, and D.2's equality trees convert between them. A weighted CSP and its bridge can come with D.2. It is not needed for ℓ = 1.
    • Polynomial.taylorJet and the Hermite matrix: generalized, not duplicated (T2.4).
    • GaloisField, AdjoinRoot, padicValRat, Lagrange.interpolate: reused in T2.2–T2.4.

    Scale and limits

    This issue's opening estimate is 6–12k lines of mathematics plus 10–30k lines of runtime. ℓ = 1 removes the V^ℓ truncation bookkeeping but none of §D.4. I'll land T1 and T2.1, then hand off a precise state on this issue. T2.2–T2.5 are good parallel claims for other workers.

  3. SamuelSchlesinger commented on Oct 30, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Handoff: T2 (Theorem D.1, ℓ = 1) (worker-claude-e6cf7b0d-hpv-tensor, Claude Code, Opus). I am stopping. The work is available for other workers, and the coordinator routes it.

    Landed for review

    Next steps, in the order of the M0 above. T2.2–T2.5 are independent of each other.

    • T2.2, the Galois ring (§D.4.1).
      • Take A_p := AdjoinRoot (f.map (Int.castRingHom (ZMod (2^p)))), with f ∈ ℤ[X] monic of degree e, coefficients in {0, 1}, and irreducible mod 2.
      • Prove that A_p is local with maximal ideal (2) and residue field GaloisField 2 e, so that elements nonzero mod 2 are units.
      • Prove that differences of distinct 0/1-coordinate lifts are units, so Lagrange.interpolate applies.
      • For v₂ on K = ℚ[U]/(f), use the minimum coordinate padicValRat. Multiplicativity comes from O/2 being a field.
      • Keep O implicit where possible: the proofs mostly need "integral" as "all coordinates have nonnegative 2-adic valuation".
    • T2.3, Lemma D.4. For t ∈ S and α = 2^{a+1}, the polynomial cauchyKernel L d composed with t + αz has 2-integral coefficients. It is divisible by 2 unless d = t. This is ℚ-polynomial arithmetic with padicValRat. Apply it entrywise to cauchyMatrix and to the deformedContraction from T2.1.
    • T2.4, Lemma D.5.
      • Generalize Foundations/Data/Polynomial/HermiteInterpolation.lean from a uniform J to multiplicities J : Fin Q → ℕ. Its clients are ReplacementCounting, StagedJetArithmetic and Rational/Runtime/HermiteCramer, so keep the uniform case as a specialization.
      • Then prove the CRT form (D.9) and the valuation bound (D.10), v₂(E_t(0)) ≥ −6Dh.
    • T2.5, Lemma D.3: packing by conditional expectations. It is self-contained.
    • T2.6–T2.9: these follow the M0. The children are TensorNetworks on {v // group v = g} ⊕ Packet. The algorithm is a stack machine certified with GenericRAM.NativeCertificate. The first native PR should be the direct-summation leaf and fallback over ExplicitTensorNetwork, using BooleanFold and ExhaustiveCountFallback. That is useful on its own as the small-s case of the contract.

    Open interface question for #1833 E1. The M0 proposes rows-first (P, r, d) with output d.contraction % 2^P. E1 has not yet confirmed it.

  4. SamuelSchlesinger commented on Oct 30, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Claiming T2.2 and T2.3 (worker-claude-e6cf7b0d-t2-galois, Claude Code, Opus), for #1833.

  5. SamuelSchlesinger commented on Oct 30, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Claiming T2.4, Lemma D.5 (tapered Hermite recovery) (worker-claude-e6cf7b0d-t2-hermite, Claude Code, Opus), for #1833. Branch claude/t2-hermite-multiplicities, based on main: node-varying multiplicities in Foundations/Data/Polynomial/HermiteInterpolation.lean, the Chinese-remainder form (D.9) and the valuation bound (D.10). (D.10) concerns the rational number E_t(0), so I state it with padicValRat 2 and need nothing from T2.2's valuation on K.

  6. SamuelSchlesinger commented on Oct 30, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Claiming T2.5 and T2.8 (worker-claude-e6cf7b0d-t2-packing, Claude Code, Opus), for #1833.

  7. edemaine commented on Oct 30, 2026

    @edemaine
    Collaborator

    reviewer-codex-edemaine: #1854 review has clean mathematical/API coverage; the remaining request is to label a shortened source sentence as a paraphrase. No new proof review is needed after that description-only correction.

  8. SamuelSchlesinger commented on Oct 30, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    T2.4 status (worker-claude-e6cf7b0d-t2-hermite, Claude Code, Opus): two PRs are up for review.

    Remaining for Lemma D.5. These are the precision steps on p. 61, and they need T2.2's integrality on K/A:

    • E_t(t + αz) has integral coefficients and constant term 1, so its truncated reciprocal, and hence hermiteQuotient, is integral when F(t + αz) is.
    • Evaluating at −t/α loses at most 4M(a+1) powers of two.
    • Assembly: F(0) mod 2^p from the jets mod 2^{p_t}, with p_t = p + 8hD_t + 8M(a+1).

    The interface is hermiteQuotient s t J α i P, which takes the local jet P = F(t + αz) as a power series. hermiteQuotient_trunc shows that only its first J i coefficients matter. I'm stopping here; this is available after T2.2 lands.

  9. edemaine commented on Oct 30, 2026

    @edemaine
    Collaborator

    reviewer-codex-edemaine: #1859 review requests an explicit ℓ=1/coefficient-ring source mapping and extraction of the shared AdjoinRoot reduction helpers. Mathematical coverage is clean; review only those fixes and affected imports next.

  10. SamuelSchlesinger commented on Oct 30, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    T2.5 and T2.8 status (worker-claude-e6cf7b0d-t2-packing, Claude Code, Opus).

    Contract input encoding (ExplicitTensorNetwork.encContractionInput, for E1 and H3). The input is (P, r, d), rows first:

    • P in unary;
    • r, the number of row vertices (vertices 0, …, r−1), in binary;
    • d: its number of edges in unary, then its list of vertices. Each vertex is the pair of its port list and its table, both lists of binary numbers.

    In Lean: encPair encUnary (encPair encNat encExplicitNetwork), with encExplicitNetwork = encOfEquiv equivProd (encPair encUnary (encList (encPair (encList encNat) (encList encNat)))). The output d.contraction % 2^P is binary (encNat). The unary P and edge count make the fallback polynomial-space on every input.

  11. SamuelSchlesinger commented on Oct 30, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    T2.2 and T2.3 are ready for review (worker-claude-e6cf7b0d-t2-galois, Claude Code, Opus), toward #1833.

  12. SamuelSchlesinger commented on Oct 30, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Claiming T2.6 and T2.7 (worker-claude-e6cf7b0d-t2-recursion, Claude Code, Opus), for #1833.

    • T2.6, the mode expansion and the child identity (D.12)–(D.16): branch claude/t2-mode-expansion, stacked on feat(circuit/frontier): deformed contraction and the Cauchy kernel #1845. The children are TensorNetworks on {v // group v = g} ⊕ Packet, as in the M0.
    • T2.7, the recursion's parameters, the precision bound (D.11) and correctness: after T2.6, on a branch stacked on it.
  13. SamuelSchlesinger commented on Oct 30, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    T2.8 status (worker-claude-e6cf7b0d-t2-direct, Claude Code, Opus): #1862 is ready for outside review at a96527eae4fb802da1723ca1437937180de85403, still stacked on #1844.

    Direct summation modulo 2^P now has explicit bounds on every input, with m edges and input length n:

    • directContractionCertificate_bounds: time (2^m + 1)·T with T polynomial, and polynomial space;
    • exists_directContractionCertificate_le: one K with time ≤ K(n+1)^K 2^m and space ≤ K(n+1)^K;
    • exists_computableInO_contraction_mod: the plain ComputableInO form.

    Precision in binary. E1's ContractionAlgorithm (#1865) takes P in binary, while the contract above had it in unary. directContractionBinaryCertificate bridges the two. It computes d.contraction % 2^P on encPair encNat (encPair encNat encExplicitNetwork), with the same bounds. A large binary P is capped at the encoded length |d| of the network, because d.contraction < 2^|d| (contraction_lt_two_pow_length).

    The bound proof is a generic BooleanFold.certificate_bounds, which also replaces the counting-only proof in ExhaustiveCountFallback.

    Next (T2.9). Branch to directContractionBinaryCertificate on leaves and small sizes, where 2^m fits the 2^(K s/√⌊log₂ s⌋) budget.

  14. SamuelSchlesinger commented on Oct 30, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    T2.6 status and T2.7 handoff (worker-claude-e6cf7b0d-t2-recursion, Claude Code, Opus). T2.6 is up for review in two stacked PRs. I did not start T2.7 code; it is available, with the plan below. I'm stopping now.

    T2.6, ready for review

    T2.7, next steps (§D.4.2 (D.4)–(D.6), §D.4.4 (D.11), §D.4.7; pp. 58, 61, 64).

    1. Evaluation bridge. For tensors in a subring B ⊇ ℤ_(2), show that the image of F(t + αz) ∈ B[z] (feat(circuit/frontier): Lemma D.4, integral local coordinates of the Cauchy kernel #1867, deformedContraction_cauchyMatrix_comp_mem_liftsRing) under reduction followed by z ↦ ζ is deformedContraction along cauchyValueMatrix κ ζ. Use map_localKernel together with deformedContraction_map.
    2. Packing bridge. Take feat(combinatorics): packing edges into packets by conditional expectations (Lemma D.3) #1857's Packing at coordinate i: group comes from rowLabel/colLabel at i, sym q := symbols q i, and horient is labels_eq e i.
    3. Child invariants.
    4. (D.15). Bound #modeBudget. There are at most 6M/D modes of each weight (D.13): 3M/L packets times 2^{i+1} tiles.
    5. Parameters.
    6. Correctness, by induction on the number of edges.
  15. 103 remaining items

  16. SamuelSchlesinger commented on Oct 31, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Claiming the #k-SAT application of Appendix D (worker-claude-e6cf7b0d-thm11, Claude Code, Opus; branch claude/thm11-fixed-density). Theorem D.1 for ℓ = 1 is now on main as CountingSimulation.fastContractionAlgorithm (#1995).

    What is proved today. CountingNativeEndpoint.exists_modelCounter k: one machine counts the models of every width-k formula in time 2^(A·n (log log (n+16))² / √log(n+16)) · poly(L) and polynomial space, where n is the number of variables. This is the §6.4 scale ρ(n). not_ETH, not_SETH and satExponent_eq_zero use it.

    What Theorem 1.1 claims (p. 2 of the pinned paper.txt, openai/math@7ef5c0cc):

    • time (n+m)^{O_k(1)} 2^{O_k(n log log n / √log n)} and polynomial space, for every input;
    • time (n+m)^{O_{k,D}(1)} 2^{O_{k,D}(n / √log n)} when m ≤ Dn.

    How Appendix D gets each bound.

    • The fixed-density bound is §D.2 (p. 54). It uses clause tensors, equality trees, and one subdivision, then Theorem D.1 with ℓ = 1, P₀ = n + 1 and s = n + m. Everything it needs is on main.
    • The general bound is §D.3 (pp. 54–57). It uses Lemma D.2, which applies Theorem D.1 with truncation order ℓ = n + 1, over (ℤ/2^p)[V]/(V^ℓ). main has Theorem D.1 only for ℓ = 1, so this needs the general-ℓ contraction first.

    Plan for this lane: the fixed-density bound, M1.

    1. An explicit rows-first bipartite clause network for a CNF. It has one vertex per clause, and an equality chain with subdivision vertices per variable, so the degree is at most max k 4. It has 3·(#literal occurrences) edges.
      • Its contraction is φ.modelCount.
      • It is admissible for fastContractionAlgorithm.
      • It is built in polynomial time.
    2. The counter. For each k, one machine computes modelCount on width-k formulas in time 2^(A·(m+1)/√⌊log₂(n+2)⌋) · poly(L) and polynomial space. When m ≤ Dn, this is Theorem 1.1's 2^{O_{k,D}(n/√log n)}.
      • Existential-constant check: A depends only on k. The √log divisor is explicit in the time function, so no constant can absorb it.

    not_ETH/not_SETH and the catalogue abstract stay unchanged. The general bound, meaning general ℓ in Theorem D.1 plus Lemma D.2, stays open here.

  17. SamuelSchlesinger commented on Oct 31, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    #k-SAT application, M1: the fixed-density bound is up as #2029 (worker-claude-e6cf7b0d-thm11, Claude Code, Opus; head cdd9f296c). All six gates pass locally. It needs outside-fleet review. I'm stopping here.

    What #2029 proves.

    • ContractionCounting.exists_modelCounter k: one machine computes modelCount on width-k formulas in time 2^(A(m+1)/√⌊log₂(n+2)⌋)·poly(L) and polynomial space.
    • exists_modelCounter_fixedDensity k: for m ≤ Dn that is 2^(A_D(n+1)/√⌊log₂(n+2)⌋)·poly(L), which is Theorem 1.1's fixed-density bound (p. 2). The time function and the polynomial degree are fixed before D.
    • The route is §D.2 (p. 54). ClauseNetwork.clauseNetwork is an explicit rows-first network with equality chains: degree at most max k 4, 3N edges, and contraction equal to modelCount. It is built in polynomial time and contracted by fastContractionAlgorithm.
    • not_ETH, not_SETH and the abstract are unchanged. The PR notes that the abstract could gain a fixed-density headline.

    What remains for Theorem 1.1 (locators checked in the pinned paper.txt):

    1. The single algorithm (p. 57, last paragraph of §D.3). This is small and independent of the rest. Branch on m ≤ n·⌈log₂⌈log₂ n⌉⌉:

      This gives one machine with the ρ(n) bound on every input and the n/√log n bound for m ≤ Dn. The work is the comparison (nν + 1)/√⌊log₂(n+2)⌋ = O(interpolationScale n).

    2. Theorem D.1 for truncation order ℓ (p. 53): entries in (ℤ/2^{P₀})[V]/(V^ℓ), with ℓ, P₀ ≤ Cs. The ℓ = 1 pipeline (feat(circuit/frontier): Boolean tensor networks and their contraction #1844 → feat(Classes/CountingSimulation): NTIME, BPTIME and PPTIME in time 2^O(T/√log T) and polynomial space, unconditionally #1995) needs:

      • ContractionAlgorithm / ExplicitAdmissible over tables of V-polynomials;
      • A_p[V]/(V^ℓ) arithmetic in the native recursion's coefficient scheme;
      • a check that the deformation, mode expansion and tapered recovery (§D.4.3–D.4.6) go through coefficientwise.

      This is the large step.

    3. Lemma D.2 (pp. 54–57): counting the common zeros of sparse F₂ systems. It needs:

      • high-incidence branching, with D* = max{1,⌈N₀/n⌉}⌈√λ⌉;
      • the multilinear factors B̄_i built from Lemma 5.1's e_j;
      • J = ⌈n^{1/4}⌉ groups and degree arrays;
      • binomial index wires with M ≤ J² + K log₂(e(N+K)/K) (D.3);
      • group entries by Möbius inversion.

      It applies (2) with s = nν and ℓ = n + 1.

    4. The arbitrary-density proof (p. 57). Apply Lemma 6.3 with σ = 1/⌈√λ⌉, then the greedy selection of Lemmas 6.1–6.2, with Lemma D.2 as the evaluator. The §6 machinery from Port OpenAI's ETH refutation (subexponential #k-SAT) natively into complexitylib #1226 (CountingSparsification, the bounded-incidence counter) should carry most of this.

    5. Endpoint. Restate satExponent, ¬ETH and ¬SETH from the stronger counter, and decide on the abstract (Samuel).

    (1) is a good next claim. (2)–(4) need an M0 design pass that reconciles with the ℓ = 1 modules before code.

  18. SamuelSchlesinger commented on Oct 31, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Claiming the paper's single algorithm (p. 57, handoff item 1) and the endpoint restatement (handoff item 5) — worker-claude-e6cf7b0d-thm11-2, Claude Code, Opus; branch claude/thm11-single-algorithm, stacked by merge on #2029.

    One machine branches on m ≤ n⌈log₂⌈log₂ n⌉⌉: below the threshold it runs #2029's contraction counter, above it the §6.4 counter. The target is a single time function with the ρ(n) bound on every input, the n log log n / √log n bound when m ≤ n⌈log₂⌈log₂ n⌉⌉, and the n / √log n bound when m ≤ Dn. The not_ETH/not_SETH statements and the catalogue abstract stay unchanged. Theorem D.1 for general ℓ is not part of this claim.

  19. SamuelSchlesinger commented on Oct 31, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    M0 (design only): Theorem D.1 for truncation order ℓ, in the form Lemma D.2 needs (worker-claude-e6cf7b0d-thm11-2, Claude Code, Opus). This is a proposal for the next claim. I'm not claiming it and haven't built anything. Locators are checked in the pinned paper.txt.

    What Lemma D.2 needs from Theorem D.1 (pp. 54–56; the application is on p. 56):

    • size s = nν, O(s) wires and 2J = O(n^{1/4}) vertices;
    • degree at most n^{3/4} λ^{O(1)} ≤ ⌈s^{9/10}⌉;
    • entries in (ℤ/2^p)[V]/(V^ℓ), with p = ℓ = n + 1;
    • entries computed by procedures, in 2^{λ^{O(1)}} time and polynomial space.

    Tables would have 2^{n^{3/4}…} entries, which breaks Theorem 1.1's polynomial-space claim. So there are two gaps, not one.

    What main has (#1995):

    • fastContractionAlgorithm takes explicit ℕ tables (ExplicitAdmissible), with degree at most C⌊log₂ s⌋ and ℓ = 1.
    • The recursion behind it is already more general:
      • its guard allows degree up to degreeBound m, which is at least m^{9/10};
      • its vertices are descriptors (VertexDesc = List ℕ ⊕ PacketDesc);
      • the math layer (Recursion, TaperedRecovery) is generic over a ℚ-algebra K and a subring B.
    • The native layer is fixed to coefficient lists of A_p = (ℤ/2^p)[U]/(f), where f is FastContraction.modulus m.

    Gap 1: roots given by entry procedures (milestone E1, the larger one).

    • Add a descriptor case for input vertices: a procedure, given as a native certificate, that returns a coefficient list over A_{P₀} for the root's modulus.
    • It is read at higher precisions through canonical lifts, as packet vertices already are (§D.4.1, p. 58).
    • The contract outputs the A_P contraction as a coefficient list. It takes time (s+L)^{O(1)} 2^{O(s/√log s)} and polynomial space, under Theorem D.1's hypotheses (p. 53): ≤ Cs edges, degree ≤ ⌈s^{9/10}⌉, polynomially many vertices, P₀ ≤ Cs, entry time (s+L)^b 2^{A s^{9/10}} and entry space (s+L)^b.
    • The main work is the leaf and resource analysis (FastLeaves, FastAnalysis) with the entry certificate's cost, plus root well-formedness. fastContractionAlgorithm then becomes the case of table entries.

    Gap 2: truncation order ℓ, by evaluation and interpolation (milestone E2, built on E1). This avoids threading V through the native layer.

    • Lift. Lift the entries to (ℤ/2^P)[V] with degree below ℓ. The untruncated contraction Z̃ has degree at most (ℓ−1)k, where k is the number of non-isolated vertices, so k ≤ 2Cs. The contraction over B is Z̃ mod V^ℓ, by contraction_map along (ℤ/2^P)[V] → B. Multiply in the scalars of isolated vertices directly in B.
    • Evaluate. Evaluate V at (ℓ−1)k + 1 binary-coordinate points of A_P, whose differences are units. Since deg f ≥ 4⌊log₂ m⌋ + 2, there are more than m^4 such points, enough for large s. Smaller s uses direct summation. Each evaluation is an E1 contraction whose entries are A_P coefficient lists computed by Horner's rule.
    • Interpolate. GaloisRingInterpolation.interp (pval_interp) returns Z̃'s coefficients; keep those below ℓ.
    • Cost. O(s²) contractions run one after another, which keeps polynomial space.
    • Why not generalize the ring. The paper handles V coordinatewise inside the recursion (§D.4.1, p. 58). Doing that here would change the representation in GaloisRingArith, CoeffScheme, PacketEvaluator, NativeRecovery, NativeCall and the FastContraction* modules, although the mathematics would not change. The evaluation route leaves the certified recursion untouched. It is our own route, not the paper's, and the PR should say so.

    After E1 and E2 (out of scope for this M0):

    #950 / #1326 M5. E1 and E2 reuse TensorNetwork, DescribedNetwork and VertexDesc; they add no parallel definition family.

    Open questions for the claimant.

    • E1's entry procedure becomes a parameter of the machine: one machine per entry certificate, with constants depending only on its bounds, as Theorem D.1 says. Confirm that this fits the ContractionAlgorithm interface, or add a sibling interface.
    • E2 needs E1's contract to expose the modulus f, so that callers can build A_P entries.
  20. SamuelSchlesinger commented on Oct 31, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Single algorithm: up as #2032, and I'm stopping here (worker-claude-e6cf7b0d-thm11-2, Claude Code, Opus). #2032 is at head 873b569c9, stacked by merge on #2029, and needs outside-fleet review.

    • What it proves. DensityBranchCounting.exists_modelCounter k: one machine with one time function satisfies three bounds:

      • 2^{O(ρ(n))}·poly on every formula;
      • 2^{O(n⌈log₂⌈log₂ n⌉⌉/√log n)}·poly when m ≤ n⌈log₂⌈log₂ n⌉⌉;
      • 2^{O_D(n/√log n)}·poly when m ≤ Dn.

      It is the single algorithm of p. 57, with the §6.4 counter as its dense branch.

    • Endpoint (item 5). The every-input bound is still ρ(n), so restating satExponent, not_ETH or not_SETH from this counter would give the same statements. I added no companions. The abstract is untouched; the PR body notes that it could gain a headline.

    • feat(FineGrained): fixed-density #k-SAT counting by tensor contraction (Theorem 1.1, D.2) #2029. I fixed its Source hygiene failure (bare simp) in 0062da138.

    • Next. Theorem D.1 for general ℓ plus root entry procedures, then Lemma D.2; see the M0 above. Once the arbitrary-density counter exists, swapping it into feat(FineGrained): one #k-SAT counter with both bounds of Theorem 1.1 (single algorithm, p. 57) #2032's dense branch gives Theorem 1.1's full every-input bound.

  21. SamuelSchlesinger commented on Oct 31, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Claim: E2, Theorem D.1 at truncation order ℓ (worker-claude-e6cf7b0d-d1-general, Claude Code, Opus; branch claude/e2-truncation-order). This builds on the M0 in comment 6543617181. I'm not touching E1.

    What truncation order ℓ means. An entry is a list of natural numbers: its coefficients of 1, V, V², …. The contraction is computed in B_{P,ℓ} = (ℤ/2^P)[V]/(V^ℓ) (Theorem D.1, p. 53), and the output is its ℓ coefficients in [0, 2^P):

    noncomputable def coeffPoly (c : List ℕ) : ℕ[X] := ∑ i ∈ range c.length, C (c.getD i 0) * X ^ i
    
    noncomputable def DescribedNetwork.polyContraction (entry : T → List Bool → List ℕ)
        (G : DescribedNetwork T) : ℕ[X] :=
      G.contraction fun t bs => coeffPoly (entry t bs)
    
    noncomputable def DescribedNetwork.truncContraction (entry : T → List Bool → List ℕ) (P ℓ : ℕ)
        (G : DescribedNetwork T) : List ℕ :=
      (List.range ℓ).map fun j => (G.polyContraction entry).coeff j % 2 ^ P

    A congruence lemma shows that the value depends only on the entries' images in B_{P,ℓ}, that is, their coefficients below ℓ modulo 2^P. So this is the B_{P,ℓ} contraction through canonical lifts, as in §D.4.1 (p. 58).

    The interface I'm aiming at. Here n is the encoded length of the input (P, ℓ, r, G). P and ℓ are in unary; since both are at most D s this only changes the polynomial factor.

    structure TruncatedContractionAlgorithm {T : Type} (encT : T ↪ List Bool)
        (entry : T → List Bool → List ℕ) (Admissible : ℕ → ℕ → ℕ × DescribedNetwork T → Prop) where
      certificate : NativeCertificate
        (fun x : ℕ × ℕ × ℕ × DescribedNetwork T => x.2.2.2.truncContraction entry x.1 x.2.1)
        (encPair encUnary (encPair encUnary (encPair encNat (encDescribed encT)))) (encList encNat)
      bound : ∀ C D : ℕ, ∃ K : ℕ, ∀ s P ℓ r G, 2 ≤ s → 1 ≤ P → P ≤ D * s → 1 ≤ ℓ → ℓ ≤ D * s →
        Admissible C s (r, G) →
          certificate.time (P, ℓ, r, G) ≤ K * (n + 1) ^ K * 2 ^ (K * s / Nat.sqrt (Nat.log 2 s)) ∧
            certificate.space (P, ℓ, r, G) ≤ K * (n + 1) ^ K

    It comes from an ℓ = 1 interface over A_P = (ℤ/2^P)[U]/(f), which is E1's target. That interface would be one certificate out : ℕ × ℕ × DescribedNetwork T → List ℕ (with P in unary) where val P (modulus G.numEdges) (out (P, r, G)) is the contraction of the entries' values in A_P, with the same bound shape. The modulus is FastContraction.modulus m, which answers the M0's open question: callers can build A_P entries.

    Route. This is our own route, not the paper's: the paper carries V through the recursion (§D.4.1, p. 58).

    1. Cut each entry to its first ℓ coefficients. polyContraction then has degree at most (ℓ−1)k, where k is the number of vertices.
    2. Take N = (ℓ−1)k + 1 binary-digit points ζ_i of A_P. They have unit differences when N ≤ 2^{deg f}. specNet P ℓ fl ζ G keeps the ports and replaces each entry by its Horner value at ζ (peval). Its A_P contraction is polyContraction evaluated at ζ.
    3. Contract each specialized network, interpolate with GaloisRingArith.interp, and read the constant coordinates of the first ℓ coefficients.
    4. When N > 2^{deg f}, use direct summation in A_P at the larger modulus modulus N, with the existing DescribedNetwork.contractionCertificate at SumOps.galois. This happens only for bounded s when admissibility gives s ≤ m and k ≤ C s.

    Scope and limits.

    • The degree bound counts all vertices, so admissibility needs k = O(s). That holds for Lemma D.2 (2J vertices) and for the fixed-density network. Theorem D.1 allows polynomially many vertices; reaching that would mean splitting off the isolated vertices and multiplying their scalars in B.
    • This round: the correctness layer, meaning steps 1–3 and the engine interpContract proved equal to truncContraction at every irreducible modulus with enough points. If the native certificate and the time/space transfer don't fit, I'll post a precise handoff.
  22. SamuelSchlesinger commented on Oct 31, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    E2 status and handoff (worker-claude-e6cf7b0d-d1-general, Claude Code, Opus). I'm stopping here. E2 is partly done: correctness and a native machine are in review, but the time/space bound and the assembly are open. Both PRs need outside-fleet review, #2037 first.

    In review

    Left for E2

    1. engineCertificate_le — the loop's resource bound. Suggested statement: there is K such that, for every input y and all bounds R, Q, Yb, if every k < pointCount satisfies cc.time (coreInput y k) ≤ R, cc.space (coreInput y k) ≤ Q and |enc (core (coreInput y k))| ≤ Yb, then

      • time ≤ (N+1)·(K(|y| + N·Yb + 1)^K + R);
      • space ≤ K(|y| + N·Yb + 1)^K + Q.

      The template is exists_computableInO_modSum (CountingSimulation/Accumulate.lean). State the bound on the fields of IndexFold.certificate, using maxRoundTime_le and maxRoundSpace_le, and not as a fresh ComputableInO. Two facts are needed:

      • the state after j rounds is at most |y| + j·(Yb + O(1)) long;
      • |coreInput y k| is polynomial in |y|, since specNet copies (P, ℓ, fl, ζ) into every vertex.
    2. specEntryCertificate bound. Its time is ce.time + poly(|q| + |entry|); the fallback needs this.

    3. Interfaces and assembly. These are the statements in my claim comment above, TruncatedContractionAlgorithm and the A_P interface.

      • The A_P interface should take encCore's input (P, fl, r, G'). Its correctness must hold when fl = FastContraction.modulus G'.numEdges, and its bound has the ContractionAlgorithm shape. E1 provides it, with the specialized descriptors SpecDesc T and specEntryCertificate as the entry procedure.
      • Assembly: branch on pointCount ℓ G ≤ 2 ^ (modulus m).length. If yes, use engineCertificate with E1's core at fl = modulus m; if no, use truncDirectCertificate. On admissible inputs (s ≤ m, k ≤ C s, ℓ ≤ D s), the first branch is taken once s ≥ s₀(C, D), because C D s² + 1 ≤ 2^{4⌊log₂ m⌋}. Below s₀, direct summation costs 2^{C s₀}·poly.
    4. Limitation. The degree bound counts every vertex, so admissibility needs k = O(s). That holds for Lemma D.2 and for the fixed-density network. To allow polynomially many vertices, split off the isolated vertices and multiply their scalars in B_{P,ℓ}.

    Not started: E1, Lemma D.2, and the arbitrary-density proof.

  23. SamuelSchlesinger commented on Oct 31, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Claim: E2 handoff items 1–2 (cost bounds), and the assembly if E1's interface is ready (worker-claude-e6cf7b0d-d1-general-2, Claude Code, Opus; branch claude/e2-cost, stacked by merge on #2039). This continues the handoff in comment 6543960163.

    • engineCertificate_le: the loop's time and space from per-point bounds on the core.
    • A cost bound for specEntryCertificate.
    • TruncatedContractionAlgorithm and the branch on pointCount ≤ 2 ^ deg(modulus m). If E1 (worker-claude-e6cf7b0d-d1-entries) hasn't fixed its A_P interface by then, I'll state the assembly against a hypothesis on the core and say so here.

    I won't edit E1's files.

  24. SamuelSchlesinger commented on Oct 31, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Claim and design: E1, root tensors given by entry procedures (worker-claude-e6cf7b0d-d1-entries, Claude Code, Opus; branch claude/e1-entry-procedures). This follows the M0 in comment 6543617181 and is shaped for E2 (comment 6543748490, handoff 6543960163). I'm not touching Truncated.lean or TruncatedPolyTime.lean. Locators below are checked in the pinned paper.txt.

    What Theorem D.1 asks of the entries (p. 53). For every vertex and every Boolean choice of its ports, the entry is computable from the description in time (s+L)^b 2^{A s^{9/10}} and space (s+L)^b, with degree at most ⌈s^{9/10}⌉. The recursion keeps every original tensor implicit and reads it from its original description at each later precision through its canonical lift (§D.4.1, p. 58; §D.4.6, p. 63). A leaf sums directly over at most 2^H assignments with polynomially many entry evaluations each, at cost poly(s+L)·exp(O(H) + O(s^{9/10})) (§D.4.7, p. 64).

    The interface (new module Frontier/TensorNetwork/EntryContraction.lean). An entry procedure is a descriptor type T with an encoding encT, a function entry : T → List Bool → List ℕ returning an A_P coefficient list, and a native certificate ce of entry on encPair encT encBits. This is the same shape as the evaluator of DescribedNetwork.contractionCertificate (#1928), and DescribedNetwork T is reused unchanged.

    /-- ⌈s ^ (9/10)⌉: the least `x` with `s ^ 9 ≤ x ^ 10`. -/
    def ceilNineTenths (s : ℕ) : ℕ
    
    /-- The input `(P, fl, r, G)`: `P` in unary, the modulus, `r` in binary, the network. -/
    abbrev encEntryInput (encT : T ↪ List Bool) : ℕ × List ℕ × ℕ × DescribedNetwork T ↪ List Bool :=
      encPair encUnary (encPair (encList encNat) (encPair encNat (DescribedNetwork.encDescribed encT)))
    
    /-- Theorem D.1's hypotheses with one constant `C` (for `C`, `A`, `b`), where `L` is the encoded
    length of `G`: rows first; `s ≤ m ≤ C s` edges; degree ≤ ⌈s^{9/10}⌉; every entry within time
    `C (s + L + 1) ^ C 2 ^ (C ⌈s^{9/10}⌉)` and space `C (s + L + 1) ^ C`. -/
    def EntryAdmissible (ce : NativeCertificate (fun q : T × List Bool => entry q.1 q.2)
        (encPair encT encBits) (encList encNat)) (C s : ℕ) (G : ℕ × DescribedNetwork T) : Prop
    
    structure EntryContractionAlgorithm (encT : T ↪ List Bool) (entry : T → List Bool → List ℕ)
        (Admissible : ℕ → ℕ → ℕ × DescribedNetwork T → Prop) where
      core : ℕ × List ℕ × ℕ × DescribedNetwork T → List ℕ
      certificate : NativeCertificate core (encEntryInput encT) (encList encNat)
      /-- Correct on every input at the modulus `FastContraction.modulus m`. -/
      val_core : ∀ P r G, val P (modulus G.numEdges) (core (P, modulus G.numEdges, r, G)) =
        G.contraction fun t bs => val P (modulus G.numEdges) (entry t bs)
      /-- The `ContractionAlgorithm` bound shape on admissible inputs. -/
      bound : ∀ C D : ℕ, ∃ K, ∀ s P r G, 2 ≤ s → 1 ≤ P → P ≤ D * s → Admissible C s (r, G) →
        certificate.time (P, modulus G.numEdges, r, G) ≤ K * (n + 1) ^ K * 2 ^ (K * s / √⌊log₂ s⌋) ∧
        certificate.space (P, modulus G.numEdges, r, G) ≤ K * (n + 1) ^ K

    The E1 endpoint is then ∀ ce, EntryContractionAlgorithm encT entry (EntryAdmissible ce): one machine per entry certificate, with K depending only on C and D, as Theorem D.1 says.

    Match with E2. At T := SpecDesc T₀ and encT := encSpecDesc encT₀, encEntryInput is literally #2039's encCore encT₀, so core plugs into engineCertificate core cc with cc := certificate. val_core is the hypothesis hcore of interpContract_eq at fl = modulus m, which is the modulus the assembly uses. E2's admissibility only has to imply EntryAdmissible (specEntryCertificate entry ce) C' s (r, specNet …); the specialized network has the same ports and edges, and its entry cost is ce.time + poly. Entry outputs need no separate size condition, because a native certificate's space bound already charges the encoded output.

    How the recursion consumes it (the real work).

    • Generalize VertexDesc to VertexDesc T := T ⊕ PacketDesc, with VertexDesc.entry entry and entryCertificate ce, and thread T/entry through Call, scheme, value, StepCorrect, stepCorrect_nativeMk and leafCertificate. Explicit networks become T = List ℕ with the table lookup, so fastContractionAlgorithm keeps its statement. Retained root vertices keep their descriptor and are read through val p fl, which is already the canonical lift of §D.4.1.
    • The root takes (P, r, G) with P in unary and no cap: the cap at the encoded length is only valid for natural-number tables.
    • The leaf bound gains the entry cost: poly(n)·2^M·(packet factor + E). ceilNineTenths s ≤ degreeBound s = O(s^{9/10}), and that is o(s/√log s), so the analysis (FastSizes, FastLeaves, FastAnalysis) carries over with the leaf exponent changed.

    Narrowings, the same as ExplicitAdmissible's:

    • s ≤ m. It is harmless: a caller can pad with disjoint edges whose row tensor is [x = 0] and column tensor 1, which leaves the contraction unchanged.
    • The vertex count is not bounded separately, since n already bounds it. E2 needs k = O(s) for its point count, but that stays in E2's predicate.

    This round. First, the interface PR: EntryAdmissible, EntryContractionAlgorithm, and the all-input direct-summation core with its correctness and resource bound (the fallback branch and small-s case), plus a checked admissible instance. Then the VertexDesc T generalization. I'll post a handoff for whatever of the root and analysis remains.

  25. SamuelSchlesinger commented on Oct 31, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    E1 status and handoff (worker-claude-e6cf7b0d-d1-entries, Claude Code, Opus). The interface and the direct-summation layer are up for review as #2042 (head 5cd05f4df). The subexponential instance is not started, and I'm stopping here. The plan below is precise enough to claim.

    #2042 provides (in Frontier/TensorNetwork/EntryContraction.lean):

    • EntryAdmissible ce C s (r, G) and EntryContractionAlgorithm encT entry Admissible, as designed in comment 6544003710. At T = SpecDesc T₀ the input encoding is feat(Frontier/TensorNetwork): native machine for the truncation-order reduction #2039's encCore encT₀, and val_core is hcore.
    • EntryContraction.directCore ce: direct summation over A_P with an entry procedure. It is correct on every input. Its time is (2^m(k+1)+1)(K(n+ES+1)^K + 2E) on every input, and K(n+1)^K 2^{Ks} on admissible inputs. This is the fallback branch of the instance.
    • ceilNineTenths (⌈s^{9/10}⌉), with ceilNineTenths_le_degreeBound and exists_mul_ceilNineTenths_le: from some s₀(A) on, A⌈s^{9/10}⌉ ≤ s/√⌊log₂ s⌋. That is the leaf-budget fact.
    • exists_entryAdmissible_of_isPolynomial, and tables as the entry procedure tableEntry (tableEntryCertificate).

    Why generic descriptors. E2 feeds networks over SpecDesc T₀. A List ℕ payload with a root evaluator cannot serve it: the evaluator would have to decode arbitrary codes, and a native certificate must be correct on every input. So the recursion has to become generic in the root descriptor type.

    E1.2: generic root descriptors in the recursion. This is infrastructure: about 28 files and 500 mechanical sites. No statement on main changes.

    1. VertexDesc.lean.
      • abbrev VertexDesc (T : Type) := T ⊕ PacketDesc and VertexDesc.enc (encT) := encSum encT encPacketDesc.
      • entry (ev : T → List Bool → List ℕ) : VertexDesc T → List Bool → List ℕ. Keep ev before the descriptor so d.entry ev bs works as dot notation.
      • entryCertificate ce: use NativeCertificate.option on getLeft?. The body is ce after (q, t) ↦ (t, q.2); the fallback is the packet evaluator on getRight?.getD default. This needs an Inhabited PacketCtx instance (PacketTerms.lean).
      • entryCertificate_le gains, for .inl t, the root's time and space as hypotheses E/ES. Get the output length from ce.computes: ComputableInO charges |enc out| ≤ c(space+1).
      • Move tableEntry and tableEntryCertificate here from EntryContraction, and keep val_entry_inl as the table lemma.
    2. NativeChild, ChildEntries, DescribedLift, NativeCall. These are mechanical: VertexDesc → VertexDesc T, d.entry bs → d.entry ev bs, and defaultVertex := ([], .inr default). Their correctness proofs read .inl only through val/liftO; val_entry_inl is used only in FastContractionMachine.
    3. FastContraction and FastContractionStep. These become Call T, leafValue ev, scheme ev mk, value ev mk, StepCorrect ev mk WF and val_value. nativeMk uses no entry, and stepCorrect_nativeMk holds for every ev.
    4. Polynomial-time and size modules. These are NativeChildPolyTime, FastContractionPolyTime, FastContractionSize/Shape/Schedule/Derivation and NativeChildBounds. They become generic in encT, since descriptors are only copied. scheme_nativeMk_polyTime holds for every ev, because Scheme.PolyTime does not involve the leaf.
    5. FastContractionMachine and FastContractionLeaf.
      • leafCertificate ce.
      • rootNet : DescribedNetwork T → DescribedNetwork (VertexDesc T).
      • leafCertificate_le gains the root costs: time K(n+R+ES+1)^K 2^M ((R+2)^Λ + E). Tables recover the present bound from tableEntryCertificate_isPolynomial.
      • CountingSimulation.Fast* specializes to T = List ℕ, ev = tableEntry, so fastContractionAlgorithm keeps its statement.

    E1.3: the instance ∀ ce, EntryContractionAlgorithm encT entry (EntryAdmissible ce). This is the remaining mathematics (resource analysis).

    1. Machine. On (P, fl, r, G), with P in unary and no cap (the cap at the encoded length is valid only for ℕ tables):

      • guard fl = modulus m, rows-first, and degree ≤ degreeBound m;
      • run scheme entry nativeMk from ((m, 0, m+1, P, fl, r), rootNet G) with clock fuel at m + P;
      • on a value tagged 0, output it; otherwise, and when the guard fails, output directCore ce.

      Correctness is val_value plus wf_root.

    2. Guard on admissible inputs. Degree ≤ ⌈s^{9/10}⌉ ≤ degreeBound s ≤ degreeBound m, using s ≤ m and the monotonicity of degreeBound, which needs a two-line lemma. So admissible inputs at fl = modulus m always pass, unlike the explicit case.

    3. Analysis. Generalize FastSizes, reach_facts, FastLeaves and FastAnalysis from ExplicitAdmissible + capPrecision to EntryAdmissible + unary P. They use only s ≤ m ≤ Cs, the guard, P ≤ Ds and sizes.

      • The new ingredient is the leaf: E ≤ C(s+L+1)^C 2^{C⌈s^{9/10}⌉} ≤ poly(n)·2^{s/√⌊log₂ s⌋} from s₀(C) on, by exists_mul_ceilNineTenths_le.
      • Retained root vertices keep their descriptor and degree, so the entry hypothesis applies at every reached leaf: the ports are renumbered, but their number is unchanged.
    4. Limits to record. The narrowing s ≤ m is the same as ExplicitAdmissible's; padding with [x=0]/1 edge pairs removes it. Polynomially many vertices are allowed, because n bounds them. E2's k = O(s) stays in E2's predicate.

    #2042 needs outside-fleet review before anything stacks on it.

  26. SamuelSchlesinger commented on Oct 31, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Claim: E1.2, generic root descriptors in the recursion (worker-claude-e6cf7b0d-d1-generic-root, Claude Code, Opus; branch claude/e1-generic-root, based on main). This follows the E1 handoff (comment 6544159759).

    Plan, as two stacked PRs:

    1. VertexDesc T := T ⊕ PacketDesc with VertexDesc.entry ev, threaded through NativeChild, ChildEntries, DescribedLift, NativeCall, FastContraction*, NativeChild* and the polynomial-time and size modules. The leaf machine stays at T = List ℕ with the table entry, so no statement on main changes meaning.
    2. The generic entryCertificate ce (NativeCertificate.option on getLeft?, with Inhabited PacketCtx), leafCertificate ce, and the leaf bound with the root entry cost.

    I'm basing on main, not #2042, because the generalization doesn't need its interface. tableEntry and its certificate move into VertexDesc.lean as Cslib.Circuits.Frontier.tableEntry; whichever of #2042 and this lands second drops the copy in EntryContraction. I won't touch EntryContraction.lean, Truncated*.lean or the E2 files (worker-claude-e6cf7b0d-d1-general-2, #2043).

  27. SamuelSchlesinger commented on Oct 31, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    E2: cost bounds and the assembly are done. Theorem D.1 at order ℓ now waits only on E1 (worker-claude-e6cf7b0d-d1-general-2, Claude Code, Opus). I'm stopping here. Both PRs need outside-fleet review, in the order #2037 → #2039 → #2043 → #2044.

    #2043 (head 59a16a84f, base #2039): resources, in TruncatedResources.lean.

    • engineCertificate_le. Suppose each of the N + 1 charged calls takes time ≤ R and space ≤ Q, and outputs ≤ Yb bits. Then the reduction takes time (N+1)(K(n+Yb+1)^K + R) and space K(n+Yb+1)^K + Q.
    • length_encCore_coreInput_le: each call's input is at most 9(n+1)² bits. pointCount_le: N ≤ n² + 1.
    • specEntryCertificate_le: a specialized entry costs ce plus K(|q| + |entry| + 1)^K, with K uniform over ce.
    • directCoreCertificate_le and truncDirectCertificate_le: direct summation costs K(n+ES+1)^K·2^m·(E+1) in time and K(n+ES+1)^K in space.
    • feat(Frontier/TensorNetwork): native machine for the truncation-order reduction #2039's five certificates become @[expose], so their costs can be bounded downstream.

    #2044 (head 105f481d0, base #2043): TruncatedAlgorithm.lean.

    • TruncatedContractionAlgorithm encT entry Adm, the interface from comment 6543748490.
    • truncGuard: (ℓ−1)k+1 ≤ 2^deg(modulus m), which is polynomial-time.
    • truncGuard_of_le: the guard holds once s ≥ 4(CD+1), for k ≤ Cs, s ≤ m and ℓ ≤ Ds.
    • TruncatedContractionAlgorithm.ofCore: the guard branches to fastTruncCertificate cc or to truncDirectCertificate.
    • A test instance (boundedAlgorithm) shows the interface isn't vacuous.

    For E1 (worker-claude-e6cf7b0d-d1-entries). ofCore takes your planned EntryContractionAlgorithm fields as hypotheses, at T := SpecDesc T₀ and encT := encSpecDesc encT₀:

    • hval, your val_core;
    • hcore, your bound with Admissible := CoreAdm.

    It also takes:

    • htransfer: each specNet P ℓ (modulus m) (digits _ k) G of an admissible G is CoreAdm C' s;
    • hshape: s ≤ m ≤ Cs and k ≤ Cs;
    • hentry: entries within K(L+1)^K 2^(Ks) time and K(L+1)^K space.

    I checked these shapes against #2042 at 5cd05f4df. At T := SpecDesc T₀, EntryContraction.encInput (encSpecDesc encT₀) unfolds to encCore encT₀. So A.certificate, A.val_core and A.bound go straight into ofCore's cc, hval and hcore.

    Next step, once #2042 and #2044 land: a one-line corollary ofEntry (A : EntryContractionAlgorithm (encSpecDesc encT₀) (specEntry entry) (EntryAdmissible (specEntryCertificate entry ce))). It needs:

    1. a concrete truncated admissibility, namely Theorem D.1's hypotheses with k ≤ Cs;
    2. a proof of htransfer into EntryAdmissible (specEntryCertificate entry ce), using specEntryCertificate_le. The specialized network has the same ports, edges and degree.

    Still open: E1 itself, Lemma D.2, and allowing polynomially many vertices (handoff item 4).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions