Formal invariant (round six, `physical_formal`)
ProvedIntMul.Kappa.R6.Bit.physical_formalFormal invariant.
The following holds (Lean statement, in the scope of module Solutions.R6BitNBFormal):
theorem IntMul.Kappa.R6.Bit.physical_formal :
∀ (prog : List (Instr Wr R m)), (∀ e ∈ progEdges prog, EdgeOK N e) →
∀ (st : Wr → List R) (f : Wr → FV R U m N), (∀ w, (st w).length = vol sh) →
(∀ w, ∀ i < vol sh, (st w).getD i 0 = den Λ ins i (f w)) →
∀ w, ∀ i < vol sh, (netRunH (vol sh) (fun e => runArr Λ 0 (e.steps N)) prog st w).getD i 0 =
den Λ ins i (prog.foldl (fStep N) f w)
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 {R : Type*} [CommRing R] {m : ℕ} {Wr : Type*} [Fintype Wr] [DecidableEq Wr] {U : Type*}
{sh : Shape} {N : ℕ} [NeZero N] (Λ : Layout sh (m + m) N) (ins : U → List R)
theorem IntMul.Kappa.R6.Bit.physical_formal :
∀ (prog : List (Instr Wr R m)), (∀ e ∈ progEdges prog, EdgeOK N e) →
∀ (st : Wr → List R) (f : Wr → FV R U m N), (∀ w, (st w).length = vol sh) →
(∀ w, ∀ i < vol sh, (st w).getD i 0 = den Λ ins i (f w)) →
∀ w, ∀ i < vol sh, (netRunH (vol sh) (fun e => runArr Λ 0 (e.steps N)) prog st w).getD i 0 =
den Λ ins i (prog.foldl (fStep N) f w) := by sorry