Provedalphabaguettebaguette-zoptimizer
The clipped gradient g·c/max(c, ‖g‖) has norm at most c
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. (
ℕ) - 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 → ℝ) - <Less than
- 0 is strictly smaller than c. (
0 < c) - ≤At most
- √(∑ i, (g(i) · (c/max(c, √(∑ j, g(j)^2))))^2) is less than or equal to c. (
Real.sqrt (∑ i, (g i * (c / max c (Real…) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - ·Multiplication
- g(i) times c/max(c, √(∑ j, g(j)^2)). (
g i * (c / max c (Real.sqrt (∑ j, g j ^…) - a/bDivision
- c divided by max(c, √(∑ j, g(j)^2)). In Lean, dividing by 0 gives 0. (
c / max c (Real.sqrt (∑ j, g j ^ 2))) - maxMaximum
- The larger of c and √(∑ j, g(j)^2). (
max c (Real.sqrt (∑ j, g j ^ 2))) - √Square root
- The non-negative number whose square is ∑ j, g(j)^2. (
Real.sqrt (∑ j, g j ^ 2)) - ∑Summation
- Add up g(j)^2 for every j. (
∑ j, g j ^ 2) - aᵇPower
- g(j) raised to the power 2. (
g j ^ 2)
theorem bz-clipped-norm-bound {n : ℕ} (g : Fin n → ℝ) (c : ℝ) (hc : 0 < c) :
Real.sqrt (∑ i, (g i * (c / max c (Real.sqrt (∑ j, g j ^ 2)))) ^ 2) ≤ cGlobal-norm clipping really enforces ‖g‖₂ ≤ c for every input gradient (c > 0). 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
- 19 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.