Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.WitnessScan.Cell

Charged original-weight zero-sum test #

The internal cell rule composes the actual two loads, their address calculations and both existing signed additions. Its result is the exact sum of the three original weights; no modular product or candidate certificate can make a nonzero original sum pass this test.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.WitnessScan.exec_testVertex {w rb ra c : ℕ} {ab bc ac : ℤ} (x : WordRAM.Data 32) (hrowB : x.regs Reg.rowB = rb) (hrowA : x.regs Reg.rowA = ra) (hindex : x.regs Reg.index = c) (hwab : x.regs Reg.wab = WordRAM.Signed.encode ab) (hBC : x.mem (rb + c) = WordRAM.Signed.encode bc) (hAC : x.mem (ra + c) = WordRAM.Signed.encode ac) (haddr : WordRAM.Fits (w + 2) (rb + ra + c + 1)) (hab : GenericRAM.Signed.Fits w ab) (hbc : GenericRAM.Signed.Fits w bc) (hac : GenericRAM.Signed.Fits w ac) (hpartial : GenericRAM.Signed.Fits w (ab + bc)) :
∃ (y : WordRAM.Data 32), WordRAM.ExecWithin (w + 2) testVertex x y 36 ∧ y.regs WordRAM.Signed.result = WordRAM.Signed.encode (ab + bc + ac) ∧ y.mem = x.mem ∧ ∀ (i : Fin 32), 9 ≤ ↑i → i ≠ Reg.address → y.regs i = x.regs i

Actual signed verification of one original candidate vertex, with every address and arithmetic instruction charged. The first partial sum must fit the next kernel's signed source range; the complete initialized caller derives this from the original weight bound.