Complete three-matrix native residue prefix #
The three genuine calls preserve all original arrays below the computed workspace and each other's already written output. All argument copies, signed remainder, decoding, stores and loop controls are charged. This is the first memory-producing stage of the complete counter.
theorem Cslib.Algorithms.WordRAM.ExactTriangle.CountPrime.exec_residueArrays {w n p k scratch a b c : ℕ} (x : WordRAM.Data 128) (u v z : ℕ → ℤ) (hp : 0 < p) (ready : CounterRegisters n p k scratch a b c x) (ha : a + n * n ≤ scratch) (hb : b + n * n ≤ scratch) (hc : c + n * n ≤ scratch) (hmod : GenericRAM.Signed.Fits w ↑p) (hu : ∀ i < n * n, GenericRAM.Signed.Fits w (u i)) (hv : ∀ i < n * n, GenericRAM.Signed.Fits w (v i)) (hz : ∀ i < n * n, GenericRAM.Signed.Fits w (z i)) (hinU : ∀ i < n * n, x.mem (a + i) = WordRAM.Signed.encode (u i)) (hinV : ∀ i < n * n, x.mem (b + i) = WordRAM.Signed.encode (v i)) (hinZ : ∀ i < n * n, x.mem (c + i) = WordRAM.Signed.encode (z i)) (hw : WordRAM.Fits (w + 2) (addressBudget n p k scratch a b c)) :
∃ (y : WordRAM.Data 128),
WordRAM.ExecWithin (w + 2) residueArrays x y (69 * (n * n) + 24) ∧ CounterRegisters n p k scratch a b c y ∧ (∀ i < n * n, y.mem (scratch + i) = (u i % ↑p).toNat) ∧ (∀ i < n * n, y.mem (scratch + n * n + i) = (v i % ↑p).toNat) ∧ (∀ i < n * n, y.mem (scratch + 2 * (n * n) + i) = (z i % ↑p).toNat) ∧ ∀ (d : ℕ), d < scratch ∨ scratch + 3 * (n * n) ≤ d → y.mem d = x.mem d
Compute all original unsigned residue words using only actual caller matrix data.