Gibbs' inequality (nonnegativity of KL divergence)
The Kullback–Leibler divergence is always nonnegative, and it is zero only when the two distributions are identical.
Gibbs’ inequality (nonnegativity of KL divergence)
Gibbs’ inequality: Let and be probability measures on a set equipped with a sigma-algebra , and let denote their Kullback–Leibler divergence (allowing the value ). Then
with equality if and only if (as measures on ).
Equivalently, in the case , writing for the Radon–Nikodym derivative (see Radon–Nikodym theorem ), one has
and equality holds if and only if -almost everywhere.
This is the basic reason relative entropy is a divergence: it is minimized uniquely at the matching law, even though it is not a metric. It is also a key input for inequalities relating KL to total variation distance , such as Pinsker's inequality .