Kullback–Leibler divergence

In the definitions below, \(G\) is a set.

DefinitionKullback–Leibler divergence#

If \(X,Y\) are two \(G\)-valued random variables, the Kullback–Leibler divergence is defined as

\[ D_{KL}(X\Vert Y) := \sum_x \mathbf{P}(X=x) \log \frac{\mathbf{P}(X=x)}{\mathbf{P}(Y=x)}. \]
LeanKLDiv
Used by 4

LemmaKullback–Leibler divergence of copy#

If \(X'\) is a copy of \(X\), and \(Y'\) is a copy of \(Y\), then \(D_{KL}(X'\Vert Y') = D_{KL}(X\Vert Y)\).

Proof

Clear from definition.

Lean

Formalized as ProbabilityTheory.IdentDistrib.KLDiv_eq.

Sources
Uses 1

LemmaGibbs inequality#

\(D_{KL}(X\Vert Y) \geq 0\).

Proof

Apply log sum inequality on the definition.

Lean

Formalized as KLDiv_nonneg.

Sources
Uses 2 · Used by 1

LemmaConverse Gibbs inequality#

If \(D_{KL}(X\Vert Y) = 0\), then \(Y\) is a copy of \(X\).

Uses 1

LemmaConvexity of Kullback–Leibler#

If \(S\) is a finite set, \(\sum_{s \in S} w_s = 1\) for some non-negative \(w_s\), and \({\bf P}(X=x) = \sum_{s\in S} w_s {\bf P}(X_s=x)\), \({\bf P}(Y=x) = \sum_{s\in S} w_s {\bf P}(Y_s=x)\) for all \(x\), then

\[ D_{KL}(X\Vert Y) \le \sum_{s\in S} w_s D_{KL}(X_s\Vert Y_s). \]
Proof

For each \(x\), replace \(\log \frac{\mathbf{P}(X_s=x)}{\mathbf{P}(Y_s=x)}\) in the definition with \(\log \frac{w_s\mathbf{P}(X_s=x)}{w_s\mathbf{P}(Y_s=x)}\) for each \(s\), and apply log sum inequality.

Lean

Formalized as KLDiv_of_convex.

Sources
Uses 2 · Used by 1

LemmaKullback–Leibler and injections#

If \(f:G \to H\) is an injection, then \(D_{KL}(f(X)\Vert f(Y)) = D_{KL}(X\Vert Y)\).

Proof

Clear from definition.

Lean

Formalized as KLDiv_of_comp_inj.

Sources
Uses 1 · Used by 2

Now let \(G\) be an additive group.

LemmaKullback–Leibler and sums#

If \(X, Y, Z\) are independent \(G\)-valued random variables, then

\[ D_{KL}(X+Z\Vert Y+Z) \leq D_{KL}(X\Vert Y). \]
Proof

For each \(z\), \(D_{KL}(X+z\Vert Y+z)=D_{KL}(X\Vert Y)\) by Kullback–Leibler and injections. Then apply Convexity of Kullback–Leibler with \(w_z=\mathbf{P}(Z=z)\).

Lean

Formalized as KLDiv_add_le_KLDiv_of_indep.

Sources
Uses 2 · Used by 1

LemmaKullback–Leibler and conditioning#

If \(X, Y\) are independent \(G\)-valued random variables, and \(Z\) is another random variable defined on the same sample space as \(X\), then

\[ D_{KL}((X|Z)\Vert Y) = D_{KL}(X\Vert Y) + \mathbb{H}[X] - \mathbb{H}[X|Z]. \]
Proof

Compare the terms correspond to each \(x\in G\) on both sides.

Lean

Formalized as condKLDiv_eq.

Sources
Used by 1

LemmaConditional Gibbs inequality#

\(D_{KL}((X|W)\Vert Y) \geq 0\).

Uses 1

The dependency explorer needs JavaScript and its graph data.

Download the complete graph data.