Provedalphabaguettealgorithm-ideac8
Power-of-two normalization: some scale 2ᵏ puts ‖x/2ᵏ‖² in [n/2, 2n)
For all and , if and , then
What the notation means · or point at any symbol
- NNatural numbers
- The natural numbers 0, 1, 2, …. In Lean they start at 0. (
ℕ) - <Less than
- 0 is strictly smaller than n. (
0 < n) - 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 n. Lean writes f x; papers write f(x). (
Fin n) - ⟹Implies
- If Fin(n), then ℝ. (Between types, A → B is the type of functions from A to B.) (
Fin n → ℝ) - ∃There exists
- At least one k makes the statement after the comma true. (
∃ k : ℤ, (n : ℝ) / 2 ≤ ∑ i, (x i / (2:ℝ…) - ∑Summation
- Add up x(i)^2 for every i. (
∑ i, x i ^ 2) - ZIntegers
- The integers …, −2, −1, 0, 1, 2, …. (
ℤ) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - aᵇPower
- x(i) raised to the power 2. (
x i ^ 2) - (x : T)As real numbers
- n read as an element of real numbers. Mathematicians leave this implicit; Lean needs it to know which kind of number is meant. (
(n : ℝ)) - a/bDivision
- n divided by 2. In Lean, dividing by 0 gives 0. (
(n : ℝ) / 2) - ≤At most
- n/2 is less than or equal to ∑ i, (x(i)/2^k)^2. (
(n : ℝ) / 2 ≤ ∑ i, (x i / (2:ℝ) ^ k) ^ 2) - ∧And
- Both hold: n/2 ≤ (∑ i, (x(i)/2^k)^2), and (∑ i, (x(i)/2^k)^2) < 2 · n. (
(n : ℝ) / 2 ≤ ∑ i, (x i / (2:ℝ) ^ k) ^ …) - ·Multiplication
- 2 times n. (
2 * n)
theorem p2n-energy-bracket (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) (hS : 0 < ∑ i, x i ^ 2) :
∃ k : ℤ, (n : ℝ) / 2 ≤ ∑ i, (x i / (2:ℝ) ^ k) ^ 2 ∧ ∑ i, (x i / (2:ℝ) ^ k) ^ 2 < 2 * nIdea C8 (power-of-two RMSNorm). For any nonzero row x of width n there is an integer k such that dividing by 2ᵏ (an exponent-field change, exact in floating point barring under/overflow) gives n/2 ≤ ‖x/2ᵏ‖² < 2n. RMSNorm gives energy just below n; this keeps it within a factor 2 with no square root, division, or rounding in the scaling.
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
- 35 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.