Log-Sum Inequality, Convexity of KL Divergence, and Concavity of Entropy

proved in Lean

A simple inequality about sums of logarithms implies that KL divergence is convex and entropy is concave: mixing distributions never raises divergence above the average, nor lowers entropy below it. These shape properties are used throughout capacity and compression calculations.

Imre Csiszár; Thomas M. Cover and Joy A. Thomas (1991) · Ch. 2 · Entropy, Divergence & Inequalities · Cover & Thomas, Theorems 2.7.1–2.7.3

Statement

For nonnegative numbers $a_i, b_i \ge 0$ with $b_i = 0 \implies a_i = 0$, $$\left(\sum_i a_i\right) \log_2 \frac{\sum_i a_i}{\sum_i b_i} \le \sum_i a_i \log_2 \frac{a_i}{b_i}.$$ Consequently, $D(P \| Q)$ is jointly convex in $(P, Q)$ (on $P \ll Q$) and $H(P)$ is concave in $P$.

How the proof works

The log-sum inequality is Jensen's inequality for the convex function t log t; convexity of divergence and concavity of entropy follow by applying it term by term to mixtures. Derived from the non-negativity of Mathlib's InformationTheory.klFun and applied coordinatewise to convex mixtures probMix t P₁ P₂.

Lean declarations (3)

The key theorems in the Lean library. Each is compiled with Lean 4, uses only the standard axioms propext, Classical.choice and Quot.sound, and is re-checked by leanchecker. Click a name to see the full proof on GitHub.

Related open problems (4)

Open problems that build on, generalize, or are analogous to this theorem.