proofs
Provedcommons

The log of softmax is log-softmax

For all ι∈Type⁡\htmlData{mx=1}{\iota \in \htmlData{mx=0}{\operatorname{Type}}}, x:ι→R\htmlData{mx=3}{x : \htmlData{mx=0}{\iota} \mathrel{\htmlData{mx=2}{\to}} \htmlData{mx=1}{\mathbb{R}}} and i∈ι\htmlData{mx=1}{i \in \htmlData{mx=0}{\iota}} (given Fintype⁡ ι\htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fintype}}\,\htmlData{mx=1}{\iota}} and Nonempty⁡ ι\htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Nonempty}}\,\htmlData{mx=1}{\iota}}):

log⁡softmax⁡(x,i)=logSoftmax⁡(x,i)\htmlData{mx=4}{\log \htmlData{mx=3}{\htmlData{mx=0}{\operatorname{softmax}}(\htmlData{mx=1}{x}, \htmlData{mx=2}{i})}} \mathrel{\htmlData{mx=9}{=}} \htmlData{mx=8}{\htmlData{mx=5}{\operatorname{logSoftmax}}(\htmlData{mx=6}{x}, \htmlData{mx=7}{i})}
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.) (ι → ℝ)
logNatural logarithm
The logarithm of softmax(x, i) to base e: the power e must be raised to to give softmax(x, i). (Real.log (Commons.softmax x i))
=Equality
log(softmax(x, i)) and logSoftmax(x, i) are the same. (Real.log (Commons.softmax x i) = Common…)
RReal numbers
The real numbers: every point on the number line. (ℝ)
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)
logSoftmax
Commons.logSoftmax: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (Commons.logSoftmax)

From our commons: Commons.log_softmax 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.

More proved statements