MathLabs
TheoremProved

Gibbs' inequality

Statement

For any two probability distributions p=(p1,…,pn)p=(p_1,\dots,p_n) and q=(q1,…,qn)q=(q_1,\dots,q_n) on the same nn outcomes (all pi,qi>0p_i, q_i > 0), D(p∥q)≥0D(p\|q) \ge 0, with equality D(p∥q)=0D(p\|q) = 0 if and only if p=qp = q.

Why is it true?

The logarithm is concave, so "on average" it lies below its tangent line. Gibbs' inequality is exactly Jensen's inequality applied to the concave function log⁡2\log_2, weighted by pp: it says that replacing each ratio qi/piq_i/p_i by its pp-weighted average (which equals 11) inside the logarithm can only increase the sum, forcing the divergence to be nonnegative.

Proof sketch

Start from the elementary inequality ln⁡x≤x−1\ln x \le x - 1 for all x>0x > 0, with equality only at x=1x=1 (this follows since f(x)=ln⁡x−(x−1)f(x) = \ln x - (x-1) has f(1)=0f(1)=0, f′(x)=1/x−1f'(x) = 1/x - 1, which is positive for x<1x<1 and negative for x>1x>1, so ff has a unique maximum at x=1x=1). Dividing by ln⁡2\ln 2 gives log⁡2x≤(x−1)/ln⁡2\log_2 x \le (x-1)/\ln 2.

Apply this with x=qi/pix = q_i/p_i for each ii: log⁡2(qi/pi)≤(qi/pi−1)/ln⁡2\log_2(q_i/p_i) \le (q_i/p_i - 1)/\ln 2. Multiply both sides by pi>0p_i > 0 (which does not flip the inequality) and sum over ii: ∑ipilog⁡2(qi/pi)≤1ln⁡2∑i(qi−pi)=1ln⁡2(∑iqi−∑ipi)=1ln⁡2(1−1)=0\sum_i p_i \log_2(q_i/p_i) \le \frac{1}{\ln 2}\sum_i (q_i - p_i) = \frac{1}{\ln 2}\left(\sum_i q_i - \sum_i p_i\right) = \frac{1}{\ln 2}(1 - 1) = 0, since both pp and qq are probability distributions summing to 11.

The left side is exactly −D(p∥q)-D(p\|q) (note the sign flip from qi/piq_i/p_i versus pi/qip_i/q_i inside the log), so this proves D(p∥q)≥0D(p\|q) \ge 0.

Equality throughout requires equality in ln⁡x≤x−1\ln x \le x-1 for every ii with pi>0p_i > 0, which happens only when qi/pi=1q_i/p_i = 1 for every such ii, i.e. p=qp = q.

Topics that use this theorem

Step-by-step proofs

No step-by-step proof yet for this theorem.

References

  1. Claude E. Shannon (1948). A Mathematical Theory of Communication
  2. Thomas M. Cover, Joy A. Thomas (2006). Elements of Information Theory
  3. David J. C. MacKay (2003). Information Theory, Inference, and Learning Algorithms
  4. Erdal Arıkan (2009). Channel Polarization: A Method for Constructing Capacity-Achieving Codes for Symmetric Binary-Input Memoryless Channels · arXiv:0807.3917