Documentation

CslibFrontier.Algorithms.WordRAM.ThreeSum.ChanHe.TraversalEmission

Exact emissions from the complete native traversal visit #

This packages the executed modulus and node calls into the worklist's semantic entry format. The heavy lists are witnesses to actual native memory, not program inputs or advice. The old prefix survives before the single output-pointer store, and every new packed cell equals the existing finite node array.

Main definitions #

Main results #

These native composition proofs are original.

structure Cslib.Algorithms.WordRAM.ThreeSum.ChanHe.Traversal.Emission (Q : Finset ℕ) (Λ : ℕ) (e : Entry) (x y : WordRAM.Data 128) (published : Bool := true) :

Semantic readback of one completed actual native visit.

theorem Cslib.Algorithms.WordRAM.ThreeSum.ChanHe.Traversal.emission_readback {n : ℕ} (published : Bool) (x : WordRAM.Data 128) (e : Entry) (hl : e.Loaded x) (hv : e.Valid n (x.regs magnitude)) (M : ℕ) (u b : WordRAM.Data 128) (hu : ∀ (i : Fin 128), 64 ≤ ↑i → i ≠ selected → u.regs i = x.regs i) (hus : u.regs selected = M) (hprefix : ∀ p < x.regs heap, u.mem p = x.mem p) (hout : NodePacking.Output (recordLayout x M) e.read u.mem b.mem) (hb : ∀ (i : Fin 128), 64 ≤ ↑i → b.regs i = u.regs i) (hMpos : 1 ≤ M) (hMle : M ≤ x.regs limit ^ 2) (hM : M = ThreeSum.ChanHe.modulus (x.regs limit).primesLE (x.regs digits) (Finset.image (e.read 0) (Finset.range (x.regs (arrayLength 0)))) (Finset.image (e.read 1) (Finset.range (x.regs (arrayLength 1)))) (Finset.image (e.read 2) (Finset.range (x.regs (arrayLength 2))))) (htable : published = true → x.regs outputs + x.regs outputCount < x.regs heap) :

Shared semantic readback after either actual delivery block. The publication flag selects fixed code; it is not runtime advice. The private-table fit is required only for publication.

theorem Cslib.Algorithms.WordRAM.ThreeSum.ChanHe.Traversal.emit_entry {w n : ℕ} (x : WordRAM.Data 128) (e : Entry) (hl : e.Loaded x) (hv : e.Valid n (x.regs magnitude)) (hs : e.Stored x.mem) (hm : 2 ≤ x.regs limit) (hmod : GenericRAM.Signed.Fits w ↑(x.regs limit ^ 2)) (hbudget : WordRAM.Fits (w + 2) (Modulus.budget (WordRAM.Data.comap kernel (modulusState x)))) (hnode : ∀ (M : ℕ), 1 ≤ M → M ≤ x.regs limit ^ 2 → GenericRAM.Signed.Fits w ↑(recordLayout x M).budget) (hN : 2 * x.regs limit ^ 2 ≤ x.regs groups) (hcard : x.regs primeCount = (x.regs limit).primesLE.card) (hbefore : x.regs bitmap + x.regs limit < x.regs heap) (hbitmap : ∀ q ≤ x.regs limit, x.mem (x.regs bitmap + q) = if Nat.Prime q then 1 else 0) (hvalues : ∀ (j : Fin 3), ∀ i < (e.data j).length, GenericRAM.Signed.Fits w (e.read j i)) (hsrc : ∀ (j : Fin 3), e.source j + (e.data j).length ≤ x.regs heap) (hone : x.regs one = 1) (htable : x.regs outputs + x.regs outputCount < x.regs heap) :

Execute both complete searches and the complete node construction for an actual loaded entry. All heavy witnesses come from the executed memory and all control work is charged.