Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.PrimeSelection.Width

Original-input width admission for concrete prime selection #

The physical threshold depends only on the original dimension, window parameter and weight bound. It covers the actual counter at every candidate modulus and the selector's square tests. No intermediate fit, primality list or counting execution is supplied.

Counter admission plus sufficient width for all selector square tests.

The threshold is positive, including for empty input matrices.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.PrimeSelection.exec_input {W n D A : ℕ} (values : List ℤ) (hlen : values.length = 3 * (n * n)) (hD : 16 ≤ D) (hv : ∀ z ∈ values, z.natAbs ≤ A) (hW : admissionWidth n D A ≤ W) :
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

Every sufficiently wide physical machine executes the initialized concrete selector and returns an attained minimum, with the actual original-input and outside-workspace frame.