Initialized concrete minimum-count prime selection #
The actual fifteen-instruction header reads raw (n,D) followed by the three original
canonical signed matrices. It computes all original array pointers and the dirty workspace
start. The selector then executes the concrete counter for every eligible prime. This rule
uses only original numerical admission; no selected prime or intermediate execution is supplied.
theorem Cslib.Algorithms.WordRAM.ExactTriangle.PrimeSelection.exec_input_at {w W n D A : ℕ} (values : List ℤ) (hlen : values.length = 3 * (n * n)) (hD : 16 ≤ D) (hv : ∀ z ∈ values, z.natAbs ≤ A) (hmag : GenericRAM.Signed.Fits w ↑(CountPrime.magnitudeBudget D.sqrt (Nat.clog 2 n) A)) (hw :
WordRAM.Fits (w + 2)
(CountPrime.addressBudget n D.sqrt (Nat.clog 2 n) (3 + 3 * (n * n)) 3 (3 + n * n) (3 + 2 * (n * n)))) (hwidth : w + 2 ≤ W) (hctrl : WordRAM.Fits W (4 * (D + 2) * (D + 2) + 4)) :
WordRAM.InputFits W (CountPrime.inputWords n D values) ∧ ∃ (y : WordRAM.Data 160),
WordRAM.ExecWithin W entryProgram (WordRAM.Data.init (CountPrime.inputWords n D values)) y (timeBound n D + 15) ∧ y.regs Reg.found = 1 ∧ ExactTriangle.IsSelectedPrime (fun (α β : Fin n) => values.getD (↑α * n + ↑β) 0)
(fun (α β : Fin n) => values.getD (n * n + ↑α * n + ↑β) 0)
(fun (α β : Fin n) => values.getD (2 * (n * n) + ↑α * n + ↑β) 0) D (y.regs Reg.best) ∧ y.regs Reg.bestCount = ExactTriangle.countZeroMod (fun (α β : Fin n) => values.getD (↑α * n + ↑β) 0)
(fun (α β : Fin n) => values.getD (n * n + ↑α * n + ↑β) 0)
(fun (α β : Fin n) => values.getD (2 * (n * n) + ↑α * n + ↑β) 0) (y.regs Reg.best) ∧ WordRAM.Data.Bounded W y ∧ ∀ (d : ℕ),
d < 3 + 3 * (n * n) ∨ CountPrime.memoryEnd n D.sqrt (Nat.clog 2 n) (3 + 3 * (n * n)) ≤ d →
y.mem d = (WordRAM.Data.init (CountPrime.inputWords n D values)).mem d
Complete original-input execution at explicit numerical admission. The final state contains an attained minimum modular count and preserves all original input cells. The fifteen-instruction header is charged; the final halt is excluded.