Provedcommons
Adding a constant to every logit leaves softmax unchanged
For all , , and (given and ):
What the notation means · or point at any symbol
- Type
- Type: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Type) - Fintype
- Fintype: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Fintype) - f(x)Function application
- Fintype applied to ι. Lean writes f x; papers write f(x). (
Fintype ι) - Nonempty
- Nonempty: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Nonempty) - ⟹Implies
- If ι, then ℝ. (Between types, A → B is the type of functions from A to B.) (
ι → ℝ) - softmax
- Commons.softmax: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Commons.softmax) - =Equality
- softmax(j ↦ x(j) + c, i) and softmax(x, i) are the same. (
Commons.softmax (fun j => x j + c) i = …) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - x ↦ f(x)Function (λ-abstraction)
- The function sending j to x(j) + c. Lean writes fun x => …; papers write x ↦ …. (
fun j => x j + c) - +Addition
- x(j) plus c. (
x j + c)
theorem softmax-shift-invariant {ι : Type} [Fintype ι] [Nonempty ι] (x : ι → ℝ) (c : ℝ) (i : ι) :
Commons.softmax (fun j => x j + c) i = Commons.softmax x iFrom our commons: Commons.softmax_add_const in the Commons.ML.Softmax definition.
How it was proved
- Proved
- 30 September 2026
- By
- Commons, with the agent “library publisher”
- 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
- 9 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.