Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.CallableFixedPrime.Core

Actual translated box-backed fixed-prime solver execution #

This internal stage composes the proved original-input source execution with the existing memory-window compiler. The caller's real setup supplies normalized source registers and the computed modulus. No source execution, list of records, readback, solver or time contract is a premise. Dirty physical memory is clipped by each translated load itself.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.CallableFixedPrime.input_fits_source {m n g p total : ℕ} (values : List ℤ) (hlen : values.length = 3 * (n * n)) (hv : ∀ z ∈ values, z.natAbs ≤ total) :

Canonical original inputs fit the width computed from a bounding raw-word sum.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.CallableFixedPrime.exec_compiled {W b m n g p total : ℕ} (values : List ℤ) (hlen : values.length = 3 * (n * n)) (hD : 16 ≤ MatrixMultiplication.Schonhage.D m) (hg : 1 ≤ g) (hp : p ∈ (MatrixMultiplication.Schonhage.D m).sqrtPrimeWindow) (hN : MatrixMultiplication.Schonhage.D m ^ 18 ≤ n) (hv : ∀ z ∈ values, z.natAbs ≤ total) (x : WordRAM.Data 419) (hb : x.regs WordRAM.MemoryWindow.Reg.base = b) (hm : x.regs WordRAM.MemoryWindow.Reg.modulus = windowSize n (MatrixMultiplication.Schonhage.D m) g p total) (hregs : ∀ (i : Fin 416), WordRAM.Fits (sourceWidth n (MatrixMultiplication.Schonhage.D m) g p total) (x.regs (Fin.castAdd 3 i))) (hinput : ∀ q < 5 + 3 * (n * n), x.mem (b + q) = (WordRAM.Data.init (PreparationInput.input n (MatrixMultiplication.Schonhage.D m) g p values)).mem q) (hw : sourceWidth n (MatrixMultiplication.Schonhage.D m) g p total ≤ W) (hfit : WordRAM.Fits W (b + windowSize n (MatrixMultiplication.Schonhage.D m) g p total)) :
have V := fun (q : ℕ) => values.getD q 0; have wAB := fun (u v : Fin n) => V (Matrix.pairIndex (u, v)); have wBC := fun (b c : Fin n) => V (n * n + Matrix.pairIndex (b, c)); have wAC := fun (u c : Fin n) => V (2 * (n * n) + Matrix.pairIndex (u, c)); have hn := ⋯; ∃ (a : WordRAM.Data 64), Instances.Output n (MatrixMultiplication.Schonhage.D m) g p V (WordRAM.Data.init (PreparationInput.input n (MatrixMultiplication.Schonhage.D m) g p values)) a ∧ ∃ (y : WordRAM.Data (416 + 3)), WordRAM.ExecWithin W (WordRAM.MemoryWindow.compile StreamingFixedPrime.program) x y (3 * FixedPrime.timeBound hn g p values a.mem) ∧ (y.regs (Fin.castAdd 3 FixedPrime.Reg.found) = 0 ∨ y.regs (Fin.castAdd 3 FixedPrime.Reg.found) = 1) ∧ y.regs (Fin.castAdd 3 FixedPrime.Reg.scans) ≤ ExactTriangle.falsePositiveCount wAB wBC wAC p + y.regs (Fin.castAdd 3 FixedPrime.Reg.found) ∧ (y.regs (Fin.castAdd 3 FixedPrime.Reg.found) = 1 ↔ ExactTriangle.HasZeroTriangle wAB wBC wAC) ∧ (y.regs (Fin.castAdd 3 FixedPrime.Reg.found) = 1 → y.regs (Fin.castAdd 3 (FixedPrime.recordBank RecordWitness.Reg.witnessA)) < n ∧ y.regs (Fin.castAdd 3 (FixedPrime.recordBank RecordWitness.Reg.witnessB)) < n ∧ y.regs (Fin.castAdd 3 (FixedPrime.recordBank RecordWitness.Reg.witnessC)) < n ∧ V (y.regs (Fin.castAdd 3 (FixedPrime.recordBank RecordWitness.Reg.witnessA)) * n + y.regs (Fin.castAdd 3 (FixedPrime.recordBank RecordWitness.Reg.witnessB))) + V (n * n + (y.regs (Fin.castAdd 3 (FixedPrime.recordBank RecordWitness.Reg.witnessB)) * n + y.regs (Fin.castAdd 3 (FixedPrime.recordBank RecordWitness.Reg.witnessC)))) + V (2 * (n * n) + (y.regs (Fin.castAdd 3 (FixedPrime.recordBank RecordWitness.Reg.witnessA)) * n + y.regs (Fin.castAdd 3 (FixedPrime.recordBank RecordWitness.Reg.witnessC)))) = 0) ∧ ∀ (q : ℕ), q < b ∨ b + windowSize n (MatrixMultiplication.Schonhage.D m) g p total ≤ q → y.mem q = x.mem q

Translate the actual complete source computation into its dirty physical window. Source register fits here are an internal setup postcondition, not a final caller admission premise. The one global scan allowance and both positive/negative decisions are preserved exactly.