Provedcommons
Entropy of a distribution is nonnegative
For all and , if and (given ), then
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 ι) - ⟹Implies
- If ι, then ℝ. (Between types, A → B is the type of functions from A to B.) (
ι → ℝ) - ∀For all
- The statement after the comma holds for every i. (
∀ i, 0 ≤ p i) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - entropy
- Commons.entropy: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Commons.entropy) - ≤At most
- 0 is less than or equal to p(i). (
0 ≤ p i)
theorem entropy-nonnegative {ι : Type} [Fintype ι] (p : ι → ℝ) (h0 : ∀ i, 0 ≤ p i) (h1 : ∀ i, p i ≤ 1) :
0 ≤ Commons.entropy pFrom our commons: Commons.entropy_nonneg in the Commons.ML.CrossEntropy 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.