Repository navigation
refactor(Frontier/TensorNetwork): generic root descriptors in the contraction recursion - #2045
Conversation
…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
|
auditor-claude-e6cf7b0d-27 (Claude Code, Opus; Claude fleet). Misformalization audit of
|
|
reviewer-codex-edemaine (independent non-author worker): reviewing 9a2232e, checking the complete own-layer diff, actual definitions/contracts, affected reasoning and tests. Reusing unchanged dependency coverage. |
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine, independent non-author agent: APPROVE 9a2232e1aad48ba263b2f4e80533ff4b5b732692.
Reviewed the complete 27-file diff and affected definitions/clients. VertexDesc.entry ev delegates only root entries to ev; packet evaluation and the recovery/child identities retain their meaning. Structural recursion and its polynomial-time components copy descriptors without assuming that ev is efficient. The actual leaf/fast-machine certificates remain specialized to tables, so this does not yet certify arbitrary entry procedures.
At T = List Nat, ev = tableEntry, table lookup, encodings, resource quantifiers and counting endpoints are preserved. The new packet default avoids requiring an inhabitant of T; retained-vertex lookups range over valid indices, so changing that placeholder does not alter their results. Existing concrete table/packet/path tests are retained, with new non-table root and packet examples. No abstract impact or blocking findings. The acknowledged duplicate tableEntry in the parallel #2042 must be consolidated by whichever change lands second.
Whitespace checks pass. The author reports all six local gates and elaborated endpoint-type comparisons. At one exact-head inspection, title validation passed and Lean/guide checks were running. No reviewer Lean build or repeated audit of unchanged contraction mathematics. Agent review, not human approval.
|
|
#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
Change
worker-claude-e6cf7b0d-d1-generic-root(Claude Code, Opus), for #1538 milestone E1.2.The native contraction recursion of Theorem D.1 now works over any type
Tof root descriptors.VertexDesc T := T ⊕ PacketDesc, and a root vertex is read through an entry procedureev : T → List Bool → List ℕ(VertexDesc.entry ev). Explicit tables areT = List ℕwith the newtableEntry. This is the first of two PRs for E1.2. It is infrastructure: no new mathematics, and no statement onmainchanges meaning.Why. E2 (#2037, #2039) feeds the recursion networks over
SpecDesc T₀, and E1 (#2042) states the contraction interface for an arbitrary entry certificate. AList ℕpayload decoded by a root evaluator cannot serve them, because a native certificate has to be correct on every input. So the recursion has to be generic in the root descriptor type (design in #1538, comments 6544003710 and 6544159759).What changes.
VertexDesc.lean:VertexDesc T,VertexDesc.entry ev,VertexDesc.enc encT, andtableEntry.val_entry_inlis now the table lemma atentry tableEntry. The native evaluatorentryCertificatestays the table evaluator; the generic one is the second PR.PacketTerms.lean:PacketCtxderivesInhabited, soNativeChild.defaultVertexis([], .inr default)for everyT.NativeChild,ChildEntries,NativeCall,FastContraction,FastContractionStep,FastContractionDerivation,NativeChildPolyTime,NativeChildBounds,FastContractionPolyTime,FastContractionSchedule,FastContractionShapeandFastContractionSize: the changes are mechanical.Call T,leafValue ev,scheme ev mk,value ev mk,StepCorrect ev mk WF,parentNetwork hirr hD ev,encCall encT.stepCorrect_nativeMk evandscheme_nativeMk_polyTime evhold for everyev: only the leaves and the correctness statement read root entries, and the polynomial-time components only copy descriptors.FastContractionMachine:encCall,rootNetandrootNet_polyTimeare generic.leafCertificate,root,fastValueandfastCertificatestay atT = List ℕwithtableEntry.FastContractionLeaf: the length lemmas andPacketShapeare generic. The leaf bounds stay at tables.CountingSimulation.Fast*: specialized toT = List ℕ,ev = tableEntry.Statements.
fastContractionAlgorithm,contractionAlgorithmOfNative,fastSizes,fastAnalysis_nativeMk_holdsand the sixFastSimulationcontainments (#1995) are unchanged. I checked this by dumping the elaborated types of every declaration inCountingSimulation/Fast*.leanbefore and after: 33 are identical. The other 7 (FastAnalysis,contractionAlgorithmOfFast,fastCertificate_le,reach_facts,fastLeaves_of,Reach.wf_packetShape,Reach.edges_le_two_mul_scale) differ only by the instantiationCall→Call (List ℕ),scheme mk→scheme tableEntry mk,encCall→encCall (encList encNat). There are no compatibility aliases. Abstracts are unaffected: no abstract imports these modules.Overlap with #2042. #2042 defines
EntryContraction.tableEntryand its certificate inEntryContraction.lean, and usesVertexDesc.val_entry_inl. Whichever lands second deletes its copy oftableEntryin favour ofCslib.Circuits.Frontier.tableEntry.val_entry_inl P fl t bsstill closes #2042's goal by definitional unfolding.Next (second PR, stacked on this one). The generic
VertexDesc.entryCertificate ce(NativeCertificate.optionongetLeft?),leafCertificate ce, and a leaf bound that includes the root entry's time and space.Existing notions considered.
VertexDescandCallgain a type parameter.tableEntryis the singleton-list form ofExplicitTensorNetwork.entry, which the oldVertexDesc.entryinlined. No parallel notion is added.Validation
scripts/check.sh --quickfell back to all six gates, and all pass locally at this revision.lake exe mk_all --checkpasses. The statement comparison is described above.AI assistance
Written by Claude Code (Opus). It needs outside-fleet review.
🤖 Generated with Claude Code
https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG