Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.CallableFixedPrime.Exec

Complete caller-safe fixed-prime solver execution #

Only runtime original scalars, canonical signed arrays and caller workspace are inputs. The program copies those arrays once, computes its width, runs the real catalogue prefix and one-slot streaming solver, and returns its actual original-coordinate witness. The proof's reference prepared state is an output of the derivation, never a layout/run/time certificate supplied by the caller. Raw old-word bounds include dirty words before any normalization.

noncomputable def Cslib.Algorithms.WordRAM.ExactTriangle.CallableFixedPrime.timeBound {m n : ℕ} (hn : 0 < n) (g p : ℕ) (values : List ℤ) (mem : ℕ → ℕ) :

All adaptation, computed modulus, translated source and five return copies, before halt. The reference memory only indexes existing finite charges; it is not an algorithm input.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.CallableFixedPrime.exec_at {W m n g p b : ℕ} (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) (x : WordRAM.Data 640) (xn : x.regs Reg.n = n) (xD : x.regs Reg.dimension = MatrixMultiplication.Schonhage.D m) (xg : x.regs Reg.groups = g) (xp : x.regs Reg.prime = p) (xb : x.regs Reg.base = b) (hab : x.regs Reg.ab + n * n ≤ b) (hbc : x.regs Reg.bc + n * n ≤ b) (hac : x.regs Reg.ac + n * n ≤ b) (vab : ∀ q < n * n, x.mem (x.regs Reg.ab + q) = WordRAM.Signed.encode (values.getD q 0)) (vbc : ∀ q < n * n, x.mem (x.regs Reg.bc + q) = WordRAM.Signed.encode (values.getD (n * n + q) 0)) (vac : ∀ q < n * n, x.mem (x.regs Reg.ac + q) = WordRAM.Signed.encode (values.getD (2 * (n * n) + q) 0)) (hfit : WordRAM.Fits W (b + 4 * windowSize n (MatrixMultiplication.Schonhage.D m) g p (rawTotal n values) + 1024)) :
have V := fun (q : ℕ) => values.getD q 0; have wAB := fun (u v : Fin n) => V (Matrix.pairIndex (u, v)); have wBC := fun (u v : Fin n) => V (n * n + Matrix.pairIndex (u, v)); have wAC := fun (u v : Fin n) => V (2 * (n * n) + Matrix.pairIndex (u, v)); 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 640), WordRAM.ExecWithin W program x y (timeBound hn g p values a.mem) ∧ (y.regs Reg.found = 0 ∨ y.regs Reg.found = 1) ∧ y.regs Reg.scans ≤ ExactTriangle.falsePositiveCount wAB wBC wAC p + y.regs Reg.found ∧ (y.regs Reg.found = 1 ↔ ExactTriangle.HasZeroTriangle wAB wBC wAC) ∧ (y.regs Reg.found = 1 → y.regs Reg.witnessA < n ∧ y.regs Reg.witnessB < n ∧ y.regs Reg.witnessC < n ∧ V (y.regs Reg.witnessA * n + y.regs Reg.witnessB) + V (n * n + (y.regs Reg.witnessB * n + y.regs Reg.witnessC)) + V (2 * (n * n) + (y.regs Reg.witnessA * n + y.regs Reg.witnessC)) = 0) ∧ (∀ (q : ℕ), q < b ∨ b + windowSize n (MatrixMultiplication.Schonhage.D m) g p (rawTotal n values) ≤ q → y.mem q = x.mem q) ∧ ∀ (j : Fin 640), ↑j < 160 ∨ 600 ≤ ↑j ∧ ↑j < 608 → y.regs j = x.regs j

Complete actual native caller execution in the existing unrestricted-data semantics. No initial whole-data bound is needed to establish execution and semantic/frame guarantees. Original-word fits are still necessary for physical-word/prefix bounds: use exec or the original-admission prefix rules for those claims. No source run or solver contract is assumed.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.CallableFixedPrime.exec {W m n g p b : ℕ} (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) (x : WordRAM.Data 640) (xn : x.regs Reg.n = n) (xD : x.regs Reg.dimension = MatrixMultiplication.Schonhage.D m) (xg : x.regs Reg.groups = g) (xp : x.regs Reg.prime = p) (xb : x.regs Reg.base = b) (hab : x.regs Reg.ab + n * n ≤ b) (hbc : x.regs Reg.bc + n * n ≤ b) (hac : x.regs Reg.ac + n * n ≤ b) (vab : ∀ q < n * n, x.mem (x.regs Reg.ab + q) = WordRAM.Signed.encode (values.getD q 0)) (vbc : ∀ q < n * n, x.mem (x.regs Reg.bc + q) = WordRAM.Signed.encode (values.getD (n * n + q) 0)) (vac : ∀ q < n * n, x.mem (x.regs Reg.ac + q) = WordRAM.Signed.encode (values.getD (2 * (n * n) + q) 0)) (hx : WordRAM.Data.Bounded W x) (hfit : WordRAM.Fits W (b + 4 * windowSize n (MatrixMultiplication.Schonhage.D m) g p (rawTotal n values) + 1024)) :
have V := fun (q : ℕ) => values.getD q 0; have wAB := fun (u v : Fin n) => V (Matrix.pairIndex (u, v)); have wBC := fun (u v : Fin n) => V (n * n + Matrix.pairIndex (u, v)); have wAC := fun (u v : Fin n) => V (2 * (n * n) + Matrix.pairIndex (u, v)); 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 640), WordRAM.ExecWithin W program x y (timeBound hn g p values a.mem) ∧ WordRAM.Data.Bounded W y ∧ (y.regs Reg.found = 0 ∨ y.regs Reg.found = 1) ∧ y.regs Reg.scans ≤ ExactTriangle.falsePositiveCount wAB wBC wAC p + y.regs Reg.found ∧ (y.regs Reg.found = 1 ↔ ExactTriangle.HasZeroTriangle wAB wBC wAC) ∧ (y.regs Reg.found = 1 → y.regs Reg.witnessA < n ∧ y.regs Reg.witnessB < n ∧ y.regs Reg.witnessC < n ∧ V (y.regs Reg.witnessA * n + y.regs Reg.witnessB) + V (n * n + (y.regs Reg.witnessB * n + y.regs Reg.witnessC)) + V (2 * (n * n) + (y.regs Reg.witnessA * n + y.regs Reg.witnessC)) = 0) ∧ (∀ (q : ℕ), q < b ∨ b + windowSize n (MatrixMultiplication.Schonhage.D m) g p (rawTotal n values) ≤ q → y.mem q = x.mem q) ∧ ∀ (j : Fin 640), ↑j < 160 ∨ 600 ≤ ↑j ∧ ↑j < 608 → y.regs j = x.regs j

Complete actual native caller execution, with the selector bank and original call arguments protected. The original source spans may alias each other and all remaining memory may be dirty. No source execution, catalogue, order, solver, witness or time bound is supplied as a premise.