Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Frames commute with pointwise linear networks

Proved
IntMul.OpenAI.frame_invariant

by xuanji · Oct 12, 2026 · Mathlib 0df444a (Lean v4.33.1)

integer-multiplicationlinear-algebra

Let RRR be a commutative ring, W\mathcal WW a finite set of wire roles and Ω\OmegaΩ an address set. Each wire carries an array in RΩR^\OmegaRΩ. A gate g=(Cg,Sg,Dg)g=(C_g,S_g,D_g)g=(Cg​,Sg​,Dg​) consists of the following:

  • a coefficient matrix Cg∈RW×WC_g\in R^{\mathcal W\times\mathcal W}Cg​∈RW×W, applied pointwise at every address, (Cgf)w(ω)=∑w′Cg(w,w′)fw′(ω)(C_g f)_w(\omega)=\sum_{w'}C_g(w,w')f_{w'}(\omega)(Cg​f)w​(ω)=∑w′​Cg​(w,w′)fw′​(ω);
  • the set SgS_gSg​ of wires it touches, with CgC_gCg​ the identity on rows outside SgS_gSg​ and rows in SgS_gSg​ reading only wires in SgS_gSg​;
  • an invertible RRR-linear frame DgD_gDg​ of RΩR^\OmegaRΩ.

Fix source frames DwinD^{\rm in}_wDwin​ and sink frames DwoutD^{\rm out}_wDwout​. The physical execution keeps, for each wire, its current frame FwF_wFw​, starting from Fw=DwinF_w=D^{\rm in}_wFw​=Dwin​ on the supplied arrays fff. Before gate ggg it applies the edge operator DgFw−1D_gF_w^{-1}Dg​Fw−1​ to each touched wire, then applies CgC_gCg​ pointwise, and sets Fw=DgF_w=D_gFw​=Dg​ on touched wires. After the last gate it applies the sink edge DwoutFw−1D^{\rm out}_wF_w^{-1}Dwout​Fw−1​. The logical execution applies the gates CgC_gCg​ pointwise to g=(Din)−1fg=(D^{\rm in})^{-1}fg=(Din)−1f. Then for every wire www,

physical outputw  =  Dwout(logical outputw),\text{physical output}_w \;=\; D^{\rm out}_w\big(\text{logical output}_w\big),physical outputw​=Dwout​(logical outputw​),

so the implemented operator is Dout SΩ (Din)−1D^{\rm out}\,S_\Omega\,(D^{\rm in})^{-1}DoutSΩ​(Din)−1.

This is the representation principle of §3.2 (equation (5)) of the OpenAI preprint Integer multiplication below nlog⁡nn\log nnlogn. It allows a finite linear network to be run on whole arrays while each wire's array changes representation along the way. Every κ-saving construction (the OpenAI networks, Colkitt's and Jain's rounds) uses it to turn cheap edge operators into a full address interchange or butterfly layer.

Formalization Note A gate is a triple (C, S, D) in a list, applied in order. The physical state is the pair (current frames, stored arrays).

Preamble
import Mathlib
open Finset
Formal statement
namespace IntMul.OpenAI

theorem frame_invariant {Wr Ω R : Type*} [CommRing R] [Fintype Wr] [DecidableEq Wr]
    (gates : List (Matrix Wr Wr R × Finset Wr × ((Ω → R) ≃ₗ[R] (Ω → R))))
    (hgates : ∀ g ∈ gates, ∀ w w', (w ∉ g.2.1 → g.1 w w' = if w = w' then 1 else 0) ∧
      (w ∈ g.2.1 → w' ∉ g.2.1 → g.1 w w' = 0))
    (Din Dout : Wr → ((Ω → R) ≃ₗ[R] (Ω → R))) (f : Wr → Ω → R) :
    let physical := gates.foldl
      (fun (st : (Wr → ((Ω → R) ≃ₗ[R] (Ω → R))) × (Wr → Ω → R)) g =>
        (fun w => if w ∈ g.2.1 then g.2.2 else st.1 w,
         fun w ω => ∑ w', g.1 w w' *
           (if w' ∈ g.2.1 then g.2.2 ((st.1 w').symm (st.2 w')) else st.2 w') ω))
      (Din, f)
    let logical := gates.foldl (fun (h : Wr → Ω → R) g => fun w ω => ∑ w', g.1 w w' * h w' ω)
      (fun w => (Din w).symm (f w))
    ∀ w, Dout w ((physical.1 w).symm (physical.2 w)) = Dout w (logical w) := by sorry

end IntMul.OpenAI
Source
OpenAI, Integer multiplication below n log n (preprint, 23 Sep 2026), https://github.com/openai/math/tree/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/Integer-multiplication-below-n-log-n-September-23-2026 , Section 3.2, equation (5) and Figure 2

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me