Provedalphabaguettebaguette-zoptimizer
With clipped gradients the second moment stays in [0, c²] forever
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. (
ℕ) - ⟹Implies
- If ℕ, then ℝ. (Between types, A → B is the type of functions from A to B.) (
ℕ → ℝ) - x : TVariables
- g, v range over ℕ → ℝ: the statement must hold for every choice. (
(g v : ℕ → ℝ)) - x ∈ TVariables
- β, c range over real numbers: the statement must hold for every choice. (
(β c : ℝ)) - ≤At most
- 0 is less than or equal to β. (
0 ≤ β) - ∀For all
- The statement after the comma holds for every t. (
∀ t, |g t| ≤ c) - ∧And
- Both hold: 0 ≤ v(0), and v(0) ≤ c^2. (
0 ≤ v 0 ∧ v 0 ≤ c ^ 2) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - |x|Absolute value
- The size of g(t) without its sign. (
|g t|) - =Equality
- v(t + 1) and β · v(t) + (1 − β) · g(t)^2 are the same. (
v (t + 1) = β * v t + (1 - β) * g t ^ 2) - f(x)Function application
- g applied to t. Lean writes f x; papers write f(x). (
g t) - +Addition
- t plus 1. (
t + 1) - aᵇPower
- c raised to the power 2. (
c ^ 2) - ·Multiplication
- β times v(t). (
β * v t) - -Subtraction
- 1 minus β. On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (
1 - β)
theorem bz-second-moment-box (g v : ℕ → ℝ) (β c : ℝ) (hβ0 : 0 ≤ β) (hβ1 : β ≤ 1) (hg : ∀ t, |g t| ≤ c) (hv0 : 0 ≤ v 0 ∧ v 0 ≤ c ^ 2) (hv : ∀ t, v (t + 1) = β * v t + (1 - β) * g t ^ 2) :
∀ t, 0 ≤ v t ∧ v t ≤ c ^ 2v(t+1) = β·v(t) + (1−β)·g(t)² with |g| ≤ c and 0 ≤ v(0) ≤ c² gives 0 ≤ v(t) ≤ c² for all t. Baguette's recorded failure grew v to 6·10³² before clipping existed; with clipping that is impossible. Part of the plan 'Baguette-Z: closed-loop certified integer-state training'.
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
- 25 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.