Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.CountPrime.Width

Original-input physical admission for the complete native counter #

A positive ceiling-logarithm threshold depends only on the original side, runtime modulus and weight bound. Every larger physical width executes the same actual initialized program. No intermediate fit, padding, table or execution certificate is an input hypothesis.

The original-input envelope dominates all native signed arithmetic and address budgets.

Positive sufficient physical width, including both bits required by native signed kernels.

Width-independent word and support envelope for every admitted wider execution.

The sufficient width is positive for every original dimension, including empty matrices.

The original-input threshold admits the signed magnitude budget and every native address. This exposes numerical admission for callers reusing the counter at a larger physical width.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.CountPrime.exec_input {W n p A : ℕ} (values : List ℤ) (hlen : values.length = 3 * (n * n)) (hp : 0 < p) (hv : ∀ z ∈ values, z.natAbs ≤ A) (hW : admissionWidth n p A ≤ W) :
WordRAM.InputFits W (inputWords n p values) ∧ ∃ (y : WordRAM.Data 128), WordRAM.ExecWithin W entryProgram (WordRAM.Data.init (inputWords n p values)) y (cost n p + 9) ∧ y.regs Reg.result = 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) p ∧ WordRAM.Data.Bounded W y ∧ ∀ (d : ℕ), d < 3 + 3 * (n * n) ∨ memoryEnd n p (Nat.clog 2 n) (3 + 3 * (n * n)) ≤ d → y.mem d = (WordRAM.Data.init (inputWords n p values)).mem d

Complete initialized structured execution at every admitted width, with original input fit, exact raw modular count, a bounded actual final state and the caller-memory frame.