Round-six lemma `psw_mul`
ProvedIntMul.Kappa.R6.Bit.psw_mulAn auxiliary lemma of the round-six development, published as a separate node because its proof is long or shared.
The following holds (Lean statement, in the scope of module Solutions.R6BitNBFormal):
theorem IntMul.Kappa.R6.Bit.psw_mul (p p' : Matrix (Fin m) (Fin m) (ZMod N)) :
psw p * psw p' = psw (p + p' - 2 * (p * p'))
Context. Round six, bit side: the formal-frame calculus (FormalOK), replacing LabOK
R6BitNBObst shows that single-label networks (LabOK: every gate touches wires with equal
frames) cannot save anything. S. Jain's two-stage network needs wires whose content is a sum of
terms at different frames: after the two stages the data outputs are A = F y and
B = F x + E y, and the copy correction (copy A, frame change T on the copy, T F = E, XOR
into B) cancels E y in characteristic two.
The calculus: a wire's content is tracked as a formal value, a finite R-combination of
framed inputs (F, u), meaning Φ(F)(ins u) (frameArr). Edges multiply every frame on the left
by the edge matrix (lmulF), gates act linearly; no label condition on gates. If every role
ρ w ends with the single term (swapMat, w), the ideal network is correct
(idealOK_of_formal), and the generalized Prop. 11 follows (prop11H_formal).
For proofs about concrete networks:
formal_labels: on a program segment whose gates are label consistent (the oldLabGates), formal values of the formL_w · φ_wevolve asL'_w · (scalar circuit on φ)_w, where the scalar circuit runs on module-valued wires (scalarStepM; here the module of formal values). So each stage of the two-stage motif is handled by its frame labels plus its scalar identity, and the stages compose through formal values.- partial swaps
psw p = [[1-p, p], [p, 1-p]]:psw p * psw q = psw (p + q - 2pq),
Formalization Note. Part of the Lean formalization of the round-six κ-improvement (integer-multiplication-kappa campaign, target IntMul.Kappa.jain_round6_framework). The statement is copied verbatim from the Lean development; the platform node carries the same declaration name. Definitions it mentions live in the IntMul_Kappa_R6_Defs* bundles (on top of the published κ bundles IntMul_Kappa_K_Defs*).
-- Round-six κ development (integer-multiplication-kappa), generated by skeleton subtraction.
import Definitions.Def_IntMul_Kappa_R6_Defs4
set_option autoImplicit false
set_option relaxedAutoImplicit false
set_option maxHeartbeats 1000000
open IntMul IntMul.Kappa IntMul.Kappa.R6 IntMul.Kappa.R6.Bit
open AModel AModelFac Matrix
variable {N m : ℕ}
theorem IntMul.Kappa.R6.Bit.psw_mul (p p' : Matrix (Fin m) (Fin m) (ZMod N)) :
psw p * psw p' = psw (p + p' - 2 * (p * p')) := by sorry