Provedalphabaguettebaguette-zv2
AdamW weights are an exponential moving average of updates (closed form)
For all and , if , 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
- θ, u range over ℕ → ℝ: the statement must hold for every choice. (
(θ u : ℕ → ℝ)) - x ∈ TVariables
- a, η range over real numbers: the statement must hold for every choice. (
(a η : ℝ)) - ∀For all
- The statement after the comma holds for every t. (
∀ t, θ (t + 1) = (1 - a) * θ t - η * u t) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - f(x)Function application
- θ applied to t + 1. Lean writes f x; papers write f(x). (
θ (t + 1)) - =Equality
- θ(t + 1) and (1 − a) · θ(t) − η · u(t) are the same. (
θ (t + 1) = (1 - a) * θ t - η * u t) - +Addition
- t plus 1. (
t + 1) - aᵇPower
- 1 − a raised to the power t. (
(1 - a) ^ t) - ·Multiplication
- 1 − a times θ(t). (
(1 - a) * θ t) - -Subtraction
- 1 minus a. On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (
1 - a) - ∑Summation
- Add up (1 − a)^(t − 1 − s) · u(s) for s = 0, 1, …, t − 1. (
∑ s ∈ Finset.range t, (1 - a) ^ (t - 1 …)
theorem bz2-adamw-ema-closed-form (θ u : ℕ → ℝ) (a η : ℝ) (hθ : ∀ t, θ (t + 1) = (1 - a) * θ t - η * u t) :
∀ t, θ t = (1 - a) ^ t * θ 0 - η * ∑ s ∈ Finset.range t, (1 - a) ^ (t - 1 - s) * u sθ(t) = (1−a)ᵗθ(0) − η·Σ_{s<t}(1−a)^(t−1−s)·u(s). This is the formal statement of the EMA view of AdamW (timescale 1/a = 1/(ηλ); Wang & Aitchison, ICML 2025), from which the box is immediate. We claim no novelty for the box. Part of 'Baguette-Z v2' (revision after the hostile review).
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
- 29 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.