thumb|200px|Josiah Willard GibbsIn information theory, Gibbs' inequality is a statement about the information entropy of a discrete probability distribution. Several other bounds on the entropy of probability distributions are derived from Gibbs' inequality, including Fano's inequality.It was first presented by J. Willard Gibbs in the 19th century.
Suppose that
P=\{p1,\ldots,pn\}
Q=\{q1,\ldots,qn\}
-
n | |
\sum | |
i=1 |
pilogpi\leq-
n | |
\sum | |
i=1 |
pilogqi
with equality if and only if
pi=qi
i=1,...n
P
Q
The difference between the two quantities is the Kullback–Leibler divergence or relative entropy, so the inequality can also be written:[2]
DKL(P\|Q)\equiv
n | |
\sum | |
i=1 |
pilog
pi | |
qi |
\geq0.
Note that the use of base-2 logarithms is optional, and allows one to refer to the quantity on each side of the inequality as an "average surprisal" measured in bits.
For simplicity, we prove the statement using the natural logarithm, denoted by, since
logba=
lna | |
lnb |
,
so the particular logarithm base that we choose only scales the relationship by the factor .
Let
I
i
lnx\leqx-1
-\sumipiln
qi | |
pi |
\geq-\sumipi\left(
qi | |
pi |
-1\right)
=-\sumiqi+\sumipi=-\sumiqi+1\geq0
The last inequality is a consequence of the pi and qi being part of a probability distribution. Specifically, the sum of all non-zero values is 1. Some non-zero qi, however, may have been excluded since the choice of indices is conditioned upon the pi being non-zero. Therefore, the sum of the qi may be less than 1.
So far, over the index set
I
-\sumipiln
qi | |
pi |
\geq0
or equivalently
-\sumipilnqi\geq-\sumipilnpi
Both sums can be extended to all
i=1,\ldots,n
pi=0
plnp
p
(-lnq)
infty
q
-
n | |
\sum | |
i=1 |
pilnqi\geq-
n | |
\sum | |
i=1 |
pilnpi
For equality to hold, we require
qi | |
pi |
=1
i\inI
ln
qi | |
pi |
=
qi | |
pi |
-1
\sumiqi=1
qi=0
i\notinI
qi=0
pi=0
This can happen if and only if
pi=qi
i=1,\ldots,n
The result can alternatively be proved using Jensen's inequality, the log sum inequality, or the fact that the Kullback-Leibler divergence is a form of Bregman divergence.
Because log is a concave function, we have that:
\sumipilog
qi | |
pi |
\lelog\sumi
p | ||||
|
=log\sumiqi\le0
Where the first inequality is due to Jensen's inequality, and the last equality is due to the same reason given in the above proof.
Furthermore, since
log
q1 | |
p1 |
=
q2 | |
p2 |
= … =
qn | |
pn |
and
\sumiqi=1
Suppose that this ratio is
\sigma
1=\sumiqi=\sumi\sigmapi=\sigma
Where we use the fact that
p,q
p=q
Alternatively, it can be proved by noting thatfor all
p,q>0
p=q
p=q
This is because the KL divergence is the Bregman divergence generated by the function
t\mapstolnt
The entropy of
P
H(p1,\ldots,pn)\leqlogn.
The proof is trivial – simply set
qi=1/n