Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.CountPrime.CoefficientMatrices

Computed spread table and both real cyclic coefficient matrices #

The table is constructed once by actual code and reused by both charged padded writers. The returned P/Q words agree with the existing mathematical specification, including the BC transpose and every padding zero. Memory below the table, including all residue arrays and original caller data, is preserved. The complete counter supplies residues through native code.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.CountPrime.exec_coefficientMatrices {w n p k scratch a b c : ℕ} (x : WordRAM.Data 128) (wBC wAC : Fin n → Fin n → ℤ) (hp : 0 < p) (ready : CounterRegisters n p k scratch a b c x) (hBC : ∀ (u v : Fin n), x.mem (x.regs Reg.residueBC + ↑u * n + ↑v) = (wBC u v % ↑p).toNat) (hAC : ∀ (u v : Fin n), x.mem (x.regs Reg.residueAC + ↑u * n + ↑v) = (wAC u v % ↑p).toNat) (hw : WordRAM.Fits w (addressBudget n p k scratch a b c)) :
∃ (y : WordRAM.Data 128), WordRAM.ExecWithin w coefficientMatrices x y ((14 * p + 48) * 4 ^ k + 11 * (2 ^ k - 1) + 15) ∧ CounterRegisters n p k scratch a b c y ∧ (∀ j < 2 ^ k, y.mem (x.regs Reg.spread + j) = Nat.Morton.spread j) ∧ (∀ i < 4 ^ k * p, y.mem (x.regs Reg.matrixP + i) = WordRAM.Signed.encode (ExactTriangle.CountPrime.pCoefficients p wAC i)) ∧ (∀ i < 4 ^ k * p, y.mem (x.regs Reg.matrixQ + i) = WordRAM.Signed.encode (ExactTriangle.CountPrime.qCoefficients p wBC i)) ∧ ∀ (d : ℕ), d < x.regs Reg.spread ∨ x.regs Reg.matrixR ≤ d → y.mem d = x.mem d

Build the actual table and both coefficient matrices from the three-matrix residue prefix. No table, monomial array, padding layout or matrix-result certificate is an algorithm input.