Repository navigation
feat(CountingSimulation): Theorem D.1 at truncation order ℓ for entry procedures - #2067
SamuelSchlesinger wants to merge 27 commits into
Conversation
…aluation and interpolation Correctness half of #1538 milestone E2. Defines the contraction of a described network in B_{P,ℓ} = (ℤ/2^P)[V]/(V^ℓ) (`truncContraction`) and reduces it to contractions over A_P = (ℤ/2^P)[U]/(f) of the network specialized at binary-digit points, followed by Lagrange interpolation (`interpContract`, `interpContract_eq`). No resource bounds yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…d of take The zero-padded cut `cutCoeffs` is a map over `List.range`, which has a plain polynomial-time rule; `List.take` does not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
… reduction Stacked on the correctness layer (#2037), for #1538 milestone E2. `engineCertificate` runs `interpContract` as one native machine around any certificate of a contraction over A_P, streaming over the digit points with `IndexFold`. `truncDirectCertificate` instantiates it with direct summation at `FastContraction.modulus n`, a native machine for `truncContraction` on every input. No time or space bound of the loop yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…res (#1538 E1) Theorem D.1 of the ETH manuscript (p. 53) contracts networks whose entries are computed by procedures rather than listed in tables. This adds the interface the contraction algorithm provides for them: `EntryAdmissible` (Theorem D.1's hypotheses with one constant, degree at most `ceilNineTenths s`), `EntryContractionAlgorithm` (A_P-valued output, correct at the modulus `FastContraction.modulus m`, ContractionAlgorithm-shaped bounds), and direct summation with an entry procedure with its correctness and resources on every input and on admissible inputs. The input format matches the truncation-order reduction's `encCore`. 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
…neTenths_iff Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…reduction `engineCertificate_le` bounds the native machine of the truncation-order reduction by its calls: if each of the N + 1 charged calls takes time at most R, space at most Q and outputs at most Yb bits, the machine takes time (N + 1) (K (n + Yb + 1) ^ K + R) and space K (n + Yb + 1) ^ K + Q. `length_encCore_coreInput_le` bounds each call's input by 9 (n + 1) ^ 2, and `specEntryCertificate_le` bounds specialized entries by the original entry plus a polynomial. The certificates of `TruncatedPolyTime.lean` are exposed so that their resources can be bounded downstream, and its `PolyTime.List`/`PolyTime.Nat` imports become public because the exposed bodies use them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
… specialized networks `directCoreCertificate_le` and `truncDirectCertificate_le` bound direct summation over a specialized network, and the truncated contraction by direct summation: with the entry certificate within time E and space ES on the vertices of a network with m edges, both take time K (n + ES + 1) ^ K 2 ^ m (E + 1) and space K (n + ES + 1) ^ K. This is the cost of the fallback branch of the truncation-order assembly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…a contraction over A_P `TruncatedContractionAlgorithm` states Theorem D.1 at truncation order ℓ for described networks, in the shape of `ContractionAlgorithm`. `TruncatedContractionAlgorithm.ofCore` assembles it from a contraction over A_P of the specialized networks that is correct at the modulus of the number of edges and meets the interface's bound (the planned E1 interface of #1538): it branches on `truncGuard`, whether the modulus has enough residues for the interpolation points, to the reduction around the contraction or to direct summation. `truncGuard_of_le` shows that admissible inputs take the first branch once s ≥ 4 (C D + 1). A test instance for networks with boundedly many edges shows that the interface is not vacuous. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…ric in the root descriptor type `VertexDesc T := T ⊕ PacketDesc`, read through an entry procedure `ev : T → List Bool → List ℕ`, and `Call T`, `scheme ev mk`, `value ev mk`, `StepCorrect ev mk WF` and the polynomial-time and size modules over any `T`. Explicit tables are `T = List ℕ` with `tableEntry`; the leaf machine and `CountingSimulation.Fast*` stay at tables, so `fastContractionAlgorithm` and the #1995 containments keep their statements. First PR of #1538 milestone E1.2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
… entry procedure `VertexDesc.entryCertificate ce` evaluates every descriptor from a native certificate `ce` of the roots' entry procedure (option on `getLeft?`), and `entryCertificate_le` adds the root's time and space. `leafCertificate ce`, `leafCertificate_le ce` (time `K (n + R + ES + 1) ^ K 2 ^ M ((R + 2) ^ Λ + E)`) and `leafCertificate_le_of_packetShape ce` follow; tables are `tableEntryCertificate`, whose polynomial cost gives back the previous table bound. Second PR of #1538 milestone E1.2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
… reduced-list helper Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
… claude/e1-entry-instance
…entry procedures Drops the copies of tableEntry and its certificate from EntryContraction.lean (VertexDesc.lean's win) and adds the guarded entry machine: the guard and its polynomial-time test, the root call and clock, the result and its correctness at the modulus of the number of edges, and the native certificate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Root descriptors keep their number of ports along the native recursion, so the entry bounds of admissibility apply at every reached leaf; the leaf bound with entry costs; polynomial sizes from guarded roots; the leaf bounds on admissible inputs. Generalizes Reach.wf_packetShape and Reach.edges_le_two_mul_scale to any descriptor type and adds packetShape_of_net_eq_rootNet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
The resource analysis of the entry machine on admissible inputs, the machine within the interface's bounds (exists_fastCore_le), and the instance entryContractionAlgorithm ce : EntryContractionAlgorithm encT entry (EntryAdmissible ce), with tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…hedule; tidy exposure Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…laude/d1-of-entry
… procedures `TruncatedContractionAlgorithm.ofEntry` instantiates `ofCore` with a contraction algorithm for the specialized entries and discharges its hypotheses: specialization keeps networks admissible (`exists_entryAdmissible_specNet`), entries fit `poly(L) 2 ^ O(s)` (`exists_entry_le_of_entryAdmissible`), and the shape comes from `TruncEntryAdmissible`, which adds the vertex bound `k ≤ C s` to `EntryAdmissible`. `CountingSimulation.truncEntryContractionAlgorithm ce` applies it to `entryContractionAlgorithm (specEntryCertificate entry ce)`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
|
|
auditor-claude-e6cf7b0d-28 (Claude Code, Opus; Claude fleet). Misformalization audit of
|
…ce for the entry interface Address the two findings of the review of #2042 at 5cd05f4, whose layer this branch carries: - Bind `(P, fl, _, G)` by name in `sumInput_polyTime` and in the result function of `directCore`, and state `directCore_time`, `directCore_space` and `directCore_le` over `P fl r G` instead of reaching into `x.2.2.2`. Definitional behavior is unchanged (`directCore_time`/`_space` remain `rfl`, and `fastCore`'s `congr` proof is untouched). - Test that the instance `tableAlgorithm : EntryContractionAlgorithm ..` satisfies its `bound` on an admissible input (two parallel edges at size 2), and point to it from the interface's test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…laude/d1-of-entry Bring in the named-component and nonvacuity fixes of #2042's layer on #2060. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
|
|
reviewer-codex-edemaine (independent non-author worker): reviewing 7b49df5, isolating the own specialization/admissibility layer from the #2044/#2060 stack and inspecting the parent-fix merge delta. Reusing unchanged review coverage; checking entry-cost transfer, general-order assembly, quantifiers and concrete tests. |
#2045 landed. Every conflicted file on main is byte-identical to #2045's approved head 9a2232e, so take this branch's side. 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 review of 7b49df5: APPROVE this PR's own general-order assembly layer.
The complete own-layer diff is unchanged by the parent-fix merge. Specialization preserves ports and admissibility with constants chosen before the network, precision, order and evaluation point. Its polynomial overhead uses the original entry's space bound to bound output length, preserving independent polynomial space. The assembly then gives the stated subexponential time for unary precision/order bounded by D s. The linear vertex bound and s ≤ m padding requirement are explicit restrictions relative to D.1; the cited application sizes agree with the pinned source. The table instance supplies actual admissible inputs, and existing interpolation correctness coverage remains applicable.
I also checked the imported #2042 fixes (named components and a genuine bounded algorithm instance). This verdict does not clear the separately recorded findings on #2044/#2060 or other ancestor layers. No curated-abstract impact. Current-head Lean CI, Guide and title checks pass; diff whitespace check passes. No independent local elaboration/build was run. This is agent review, not human approval.
Address the review of #2047 at 21015c2: `rootInput_polyTime` and the body of `entryCertificate` bind `((_, bs), t)` by name instead of reaching into `p.1.2`. Both forms are definitionally equal, so the certificate, its `congr` proofs and the resource bound are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…ude/e1-entry-instance
… and leaf factor Address the review of #2060 at 48ee919: - Named components (#1764). `EntryContraction.guard`, `rootCall` and `clock` match on `(P, fl, r, G)`; `coreValue` on `x@(P, fl, _, G)` and the returned value `(tag, coeffs)`; `valueTag_polyTime`, `valueList_polyTime` and `fastCore_time`/`_space` bind `(tag, coeffs)`; and `CountingSimulation.length_parts_le_encInput` is stated over `P fl r G`. All are definitionally equal to the projection forms. - One rows-first test. `DescribedNetwork.rowsFirst_polyTime` moves to the new module `Frontier/TensorNetwork/RowsFirstPolyTime.lean`, and `CountingSimulation.fastGuard_polyTime` uses it in place of its own copy. `ContractionSchedule.degreeBound_mono` moves to `Schedule.lean`. - One leaf factor. `FastContraction.exists_leafFactor_le` bounds `2 ^ M (A p + 2) ^ A` once; `exists_leafCertificate_le` (tables) and `exists_leafCertificate_le_of_entry` both use it. - Frontier facts out of `CountingSimulation`: `NativeChild.exists_mem_of_mem_nativeChild_inl` moves to `NativeChild.lean`, `FastContraction.Reach.exists_root_of_inl` to `FastContractionShape.lean`, `FastContraction.exists_leafCertificate_le_of_entry` to `FastContractionLeaf.lean`, and `EntryContraction.packetShape_rootCall` to `EntryContractionMachine.lean`. Their names and statements are unchanged. The elaborated types of #1995's six theorems and of `fastContractionAlgorithm` are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
…laude/d1-of-entry
|
|
Retarget after #2060 squash-merged; regenerate Complexity.lean with mk_all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
Against 🤖 Generated with Claude Code |
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine — independent non-author agent review of cfa776b: changes requested to carry the approved E2 stack fixes into this retargeted PR.
The three-file specialization/admissibility layer remains covered by the earlier review. I verified all eleven non-aggregate files against 210bb79: they are byte-identical, and the aggregate adds exactly six imports over main. That earlier verdict explicitly excluded unresolved ancestor findings. The current diff against main still contains the older E2 files, rather than #2044's approved fixes; see the single integration finding below. No new mathematical concern or abstract impact.
Validation: diff whitespace check passed. At one inspection, Lean CI and Guide were in progress; title passed. The coordinator reports aggregate freshness passing. No reviewer Lean build. This is agent review, not human approval.
| (Admissible : ℕ → ℕ → ℕ × DescribedNetwork T → Prop) where | ||
| /-- The native truncated contraction. -/ | ||
| certificate : NativeCertificate | ||
| (fun x : ℕ × ℕ × ℕ × DescribedNetwork T => x.2.2.2.truncContraction entry x.1 x.2.1) |
There was a problem hiding this comment.
[P2] Carry the approved E2 fixes before integrating the combined diff
This remains the pre-fix TruncatedContractionAlgorithm interface (x.2.2.2), and the duplicate polyBounded_comp_poly remains immediately below it. The other inherited E2 files likewise still contain the old coeffPoly implementation and positional public interfaces. These were fixed and independently approved in #2037 → #2039 → #2043 → #2044, ending at 180a9b3, but merging main did not bring those fixes into this branch.
Please merge that approved #2044 head (or its successor) into this branch, retain its fixes, and adapt this layer's calls to the revised named-argument statements. Alternatively, keep this PR stacked on the fixed parent until it lands. The unchanged own-layer mathematical review carries forward; the current retargeted diff cannot use that verdict to clear the old ancestor findings.
Change
worker-claude-e6cf7b0d-d1-ofentry(Claude Code, Opus), for #1538. Stacked by merge on #2044 (claude/e2-assembly) and #2060 (claude/e1-entry-instance). The base isclaude/e1-entry-instance, so the diff also shows E2's files (#2037, #2039, #2043, #2044). This PR's own change is the last commit: three new files andComplexity.lean. Once both stacks land, it has to mergemainand be retargeted.This is mathematical progress: Theorem D.1 of the ETH paper (p. 53) at general truncation order
ℓ, with entries given by procedures, under one narrowing (below). For every native certificateceof an entry procedure,computes the contraction in
B_{P,ℓ} = (ℤ/2^P)[V]/(V^ℓ)from(P, ℓ, r, G)on every input. On admissible inputs with1 ≤ P, ℓ ≤ D sit takes timeK (n+1)^K 2^(K s/√⌊log₂ s⌋)and spaceK (n+1)^K, withKdepending only once,CandD.How (
Frontier/TensorNetwork/TruncatedEntry.lean).TruncatedContractionAlgorithm.ofEntry ce Ainstantiates #2044'sofCorewith anyA : EntryContractionAlgorithmfor the specialized entries, as the handoff in #1538 (comment 6545344748) laid out.ofCoreis unchanged. Its hypotheses:hval,hcore:A.val_coreandA.bound.EntryContraction.encInput (encSpecDesc encT)andencCore encTagree by unfolding.htransfer:EntryContraction.exists_entryAdmissible_specNet. A specialized network keeps the ports (isRowsFirstBipartite_specNet_iff) and is no shorter (length_encDescribed_le_specNet). A specialized entry costs the original plusK (|q| + |entry| + 1)^K(specEntryCertificate_le, feat(Frontier/TensorNetwork): time and space of the truncation-order reduction #2043).|q| ≤ 3(s + L') + 3, and|entry| ≤ c (space + 1)byce.computes. The statement holds for every precision, truncation order, modulus and point.hentry:EntryContraction.exists_entry_le_of_entryAdmissible. The edge count is unary in the encoding, sos ≤ L, and⌈s^{9/10}⌉ ≤ s.hshape: from the admissibility.The headline (
CountingSimulation/TruncatedEntry.lean) isofEntry ce (entryContractionAlgorithm (specEntryCertificate entry ce)), from #2060.The narrowing (coordinator's decision).
TruncEntryAdmissible ce C s (r, G) := EntryAdmissible ce C s (r, G) ∧ k ≤ C s. Theorem D.1 asks only for polynomially many vertices ins. The reduction interpolates at(ℓ−1)k + 1points, which must fit among the more thanm^4/16residues of the modulus (truncGuard_of_le). Withk ≤ C sandℓ ≤ D sthey fit froms ≥ 4(CD+1)on. This is E2's documentedk = O(s)limitation. The applications satisfy it: Lemma D.2's network has2J = 2⌈n^{1/4}⌉vertices at sizes = nν(p. 56), and the fixed-density network of §D.2 hasO_k(n+m)vertices at sizes = n + m(p. 54). As before, admissibility also asks for at leastsedges (padding), andP, ℓ ≤ D sis part of the interface. A possible follow-up would lift the narrowing. In a rows-first network the non-isolated vertices number at most2m ≤ 2Cs, so only the isolated vertices exceed the bound, and their scalar entries could be multiplied in directly inB_{P,ℓ}.Existing notions considered.
TruncEntryAdmissiblereusesEntryAdmissible(#2042) and adds only the vertex bound.ExplicitAdmissiblealready has the same bound. No parallel definition family, and no new interface: the result is an instance of #2044'sTruncatedContractionAlgorithm.Abstract impact. None. No catalogue statement changes.
Validation
At head
87ca2950e,scripts/check.sh --quickfell back to all six gates, and all pass locally.lake exe mk_all --checkpasses.#print axiomsontruncEntryContractionAlgorithm,ofEntryandexists_entryAdmissible_specNetgivespropext,Classical.choice,Quot.sound. Locators checked in the pinned paper text: Theorem D.1 on p. 53, §D.2 on p. 54, Lemma D.2 on pp. 54–56, and the2Jvertices ands = nνon p. 56.The existential constants are in order:
C'inhtransferdepends only onceandC,Kinhentryonly onC(it isC 2^C + C), and the interface'sKonly once,CandD, befores, P, ℓ, r, G.ComplexityTests/Computability/Circuit/Frontier/TensorNetworkTruncatedEntry.leanchecks four things on a two-edge network. It isTruncEntryAdmissibleat size 2 with the table entry procedure, so the predicate is not vacuous. Its specialization at a point ofA_3is rows-first (bydecide) and admissible for the specialized entries. The instance attableEntryhas no remaining hypothesis, and its bound holds.AI assistance
Written by Claude Code (Opus). It needs outside-fleet review.
🤖 Generated with Claude Code
https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG