Theorem. An affine function squares to the dot form [fdip-00PK]

Suppose \(f(x+\varepsilon _i)-f(x)=a_i\) for every vertex \(x\) and every axis \(i\), with each \(a_i\) in \(k\). Then, on every cochain, \[[\mathbf {D},f]^2=-\Bigl (\sum _{i=1}^{n}a_i^2\Bigr ).\] A function on the whole torus with those constant differences exists if and only if \(Na_i=0\) in \(k\) for every \(i\). If the differences equal \(a_i\) only on the edges that meet a set \(U\) of vertices, the same identity holds for every cochain supported on the cubes whose vertices lie in \(U\) and whose one-step shifts along the axes still lie in \(U\).