proofs
Provedalphabaguettermsnormdeferred-normalization

Deferred RMSNorm: the pre-scale inner product ⟨dy, u⟩ is ⟨dy, r·u⟩ / r

For all m∈N\htmlData{mx=1}{m \in \htmlData{mx=0}{\mathbb{N}}}, dy,u:Fin⁡ m→R\htmlData{mx=5}{\mathit{dy}, u : \htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fin}}\,\htmlData{mx=1}{m}} \mathrel{\htmlData{mx=4}{\to}} \htmlData{mx=3}{\mathbb{R}}} and r∈R\htmlData{mx=1}{r \in \htmlData{mx=0}{\mathbb{R}}}, if r≠0\htmlData{mx=0}{r} \mathrel{\htmlData{mx=1}{\neq}} 0, then

∑idy(i)⋅u(i)=∑idy(i)⋅(r⋅u(i))r\htmlData{mx=7}{\sum_{i} \htmlData{mx=6}{\htmlData{mx=2}{\htmlData{mx=0}{\mathit{dy}}(\htmlData{mx=1}{i})} \cdot \htmlData{mx=5}{\htmlData{mx=3}{u}(\htmlData{mx=4}{i})}}} \mathrel{\htmlData{mx=20}{=}} \htmlData{mx=19}{\frac{\htmlData{mx=17}{\sum_{i} \htmlData{mx=16}{\htmlData{mx=10}{\htmlData{mx=8}{\mathit{dy}}(\htmlData{mx=9}{i})} \cdot (\htmlData{mx=15}{\htmlData{mx=11}{r} \cdot \htmlData{mx=14}{\htmlData{mx=12}{u}(\htmlData{mx=13}{i})}})}}}{\htmlData{mx=18}{r}}}
What the notation means · or point at any symbol
NNatural numbers
The natural numbers 0, 1, 2, …. In Lean they start at 0. (ℕ)
Fin
Fin: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (Fin)
f(x)Function application
Fin applied to m. Lean writes f x; papers write f(x). (Fin m)
⟹Implies
If Fin(m), then ℝ. (Between types, A → B is the type of functions from A to B.) (Fin m → ℝ)
x : TVariables
dy, u range over Fin m → ℝ: the statement must hold for every choice. ((dy u : Fin m → ℝ))
≠Not equal
r and 0 are different. (r ≠ 0)
∑Summation
Add up dy(i) · u(i) for every i. (∑ i, dy i * u i)
=Equality
∑ i, dy(i) · u(i) and (∑ i, dy(i) · (r · u(i)))/r are the same. (∑ i, dy i * u i = (∑ i, dy i * (r * u i…)
·Multiplication
dy(i) times u(i). (dy i * u i)
RReal numbers
The real numbers: every point on the number line. (ℝ)
a/bDivision
∑ i, dy(i) · (r · u(i)) divided by r. In Lean, dividing by 0 gives 0. ((∑ i, dy i * (r * u i)) / r)

The deferred backward needs ⟨dy, u⟩ for the unscaled projection output u. It is recoverable from the saved, scaled output y = r·u (r ≠ 0) as ⟨dy, y⟩/r, so u never has to be stored. Part of the idea 'Deferred RMS normalization for Baguette'.

How it was proved

Proved
3 October 2026
By
Ajax, with the agent “Baguette math & proofs (Claude Code, 2026-10-03)”
Checked by
Lean's kernel (Lean 4.33.1, with Mathlib); the proof is signed and replays offline
Axioms
Classical.choice, Quot.sound, propext
Proof
12 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.

More proved statements