Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.CountPrime.MatrixCell

Actual native padded coefficient-matrix cell #

One cell executes its runtime division/remainder, actual spread-table reads and Morton address arithmetic, both padding guards, real residue read when admitted, every coefficient write and index increment. The table is constructed by the preceding native spread stage; this internal execution theorem describes its current-state meaning for composition.

Exactly the row/column/scan/coefficient/address temporaries used by a matrix cell.

Instances For
    theorem Cslib.Algorithms.WordRAM.ExactTriangle.CountPrime.exec_matrixStep {w n p k source destination table i : ℕ} (transpose : Bool) (x : WordRAM.Data 128) (hn : x.regs Reg.side = n) (hp : x.regs Reg.modulus = p) (hN : x.regs Reg.paddedSide = 2 ^ k) (hindex : x.regs Reg.index = i) (hi : i < 4 ^ k) (hsrc : x.regs Reg.residueSource = source) (hdst : x.regs Reg.destination = destination) (ht : x.regs Reg.spread = table) (h0 : x.regs Reg.zero = 0) (h1 : x.regs Reg.one = 1) (h2 : x.regs Reg.two = 2) (htable : ∀ j < 2 ^ k, x.mem (table + j) = Nat.Morton.spread j) (hw : WordRAM.Fits w (destination + 4 ^ k * p + table + 4 ^ k + 2 ^ k + source + n * n + p + 16)) :
    ∃ (y : WordRAM.Data 128), WordRAM.ExecWithin w (matrixStep transpose) x y (7 * p + 22) ∧ y.regs Reg.index = i + 1 ∧ (∀ j < p, y.mem (destination + Nat.Morton.index (i / 2 ^ k) (i % 2 ^ k) * p + j) = if j = if i / 2 ^ k < n ∧ i % 2 ^ k < n then x.mem (source + if transpose = true then i % 2 ^ k * n + i / 2 ^ k else i / 2 ^ k * n + i % 2 ^ k) else p then 2 else 0) ∧ (∀ (d : ℕ), d < destination + Nat.Morton.index (i / 2 ^ k) (i % 2 ^ k) * p ∨ destination + Nat.Morton.index (i / 2 ^ k) (i % 2 ^ k) * p + p ≤ d → y.mem d = x.mem d) ∧ ∀ (r : Fin 128), ¬MatrixLocal r → y.regs r = x.regs r

    Construct one complete padded p-coefficient cell from actual current source/table words. All address, division, comparison, coefficient and control fits follow from a numerical envelope; no matrix cell, residue answer, table lookup or running time is supplied by an oracle.