# Pinsker's inequality

In information theory, Pinsker's inequality, named after its inventor Mark Semenovich Pinsker, is an inequality that bounds the total variation distance (or statistical distance) in terms of the Kullback–Leibler divergence. The inequality is tight up to constant factors.

## Formal statement

Pinsker's inequality states that, if $P$ and $Q$ are two probability distributions on a measurable space $(X,\Sigma )$, then
    $\delta (P,Q)\leq {\sqrt {{\frac {1}{2}}D_{\mathrm {KL} }(P\parallel Q)}},$
where
    $\delta (P,Q)=\sup {\bigl \|P(A)-Q(A)|\mid \quad A\in \Sigma {\text{ is a measurable event}}{\bigr \}}$
is the total variation distance (or statistical distance) between $P$ and $Q$ and
    $D_{\mathrm {KL} }(P\parallel Q)=\operatorname {E} _{P}\left(\log {\frac {\mathrm {d} P}{\mathrm {d} Q}}\right)=\int _{X}\left(\log {\frac {\mathrm {d} P}{\mathrm {d} Q}}\right)\,\mathrm {d} P$
is the Kullback–Leibler divergence in nats. When the sample space $X$ is a finite set, the Kullback–Leibler divergence is given by
    $D_{\mathrm {KL} }(P\parallel Q)=\sum _{i\in X}\left(\log {\frac {P(i)}{Q(i)}}\right)P(i)\!$
Note that in terms of the total variation norm $\|P-Q\|$ of the signed measure $P-Q$, Pinsker's inequality differs from the one given above by a factor of two:
    $\|P-Q\|\leq {\sqrt {2D_{\mathrm {KL} }(P\parallel Q)}}.$
A proof of Pinsker's inequality uses the partition inequality for f-divergences.

### Alternative version

Note that the expression of Pinsker inequality depends on what basis of logarithm is used in the definition of KL-divergence. $D_{KL}$ is defined using $\ln$ (logarithm in base $e$), whereas $D$ is typically defined with $\log _{2}$ (logarithm in base 2). Then,
    $D(P\parallel Q)={\frac {D_{KL}(P\parallel Q)}{\ln 2}}.$
Given the above comments, there is an alternative statement of Pinsker's inequality in some literature that relates information divergence to variation distance:
    $D(P\parallel Q)={\frac {D_{KL}(P\parallel Q)}{\ln 2}}\geq {\frac {1}{2\ln 2}}V^{2}(p,q),$
i.e.,
    ${\sqrt {\frac {D_{KL}(P\parallel Q)}{2}}}\geq {\frac {V(p,q)}{2}},$
in which
    $V(p,q)=\sum _{x\in {\mathcal {X}}}|p(x)-q(x)|$
is the (non-normalized) variation distance between two probability density functions $p$ and $q$ on the same alphabet ${\mathcal {X}}$.
This form of Pinsker's inequality shows that "convergence in divergence" is a stronger notion than "convergence in variation distance".
A simple proof by John Pollard is shown by letting $r(x)=P(x)/Q(x)-1\geq -1$:
    ${\begin{aligned}D_{KL}(P\parallel Q)&=E_{Q}[(1+r(x))\log(1+r(x))-r(x)]\\&\geq {\frac {1}{2}}E_{Q}\left[{\frac {r(x)^{2}}{1+r(x)/3}}\right]\\&\geq {\frac {1}{2}}{\frac {E_{Q}[|r(x)|]^{2}}{E_{Q}[1+r(x)/3]}}&{\text{(from Titu's lemma)}}\\&={\frac {1}{2}}E_{Q}[|r(x)|]^{2}&{\text{(As }}E_{Q}[1+r(x)/3]=1{\text{ )}}\\&={\frac {1}{2}}V(p,q)^{2}.\end{aligned}}$
Here Titu's lemma is also known as Sedrakyan's inequality.
Note that the lower bound from Pinsker's inequality is vacuous for any distributions where $D_{\mathrm {KL} }(P\parallel Q)>2$, since the total variation distance is at most $1$. For such distributions, an alternative bound can be used, due to Bretagnolle and Huber (see, also, Tsybakov):
    $\delta (P,Q)\leq {\sqrt {1-e^{-D_{\mathrm {KL} }(P\parallel Q)}}}.$

## History

Pinsker first proved the inequality with a greater constant. The inequality in the above form was proved independently by Kullback, Csiszár, and Kemperman.

## Inverse problem

A precise inverse of the inequality cannot hold: for every $\varepsilon >0$, there are distributions $P_{\varepsilon },Q$ with $\delta (P_{\varepsilon },Q)\leq \varepsilon$ but $D_{\mathrm {KL} }(P_{\varepsilon }\parallel Q)=\infty$. An easy example is given by the two-point space $\{0,1\}$ with $Q(0)=0,Q(1)=1$ and $P_{\varepsilon }(0)=\varepsilon ,P_{\varepsilon }(1)=1-\varepsilon$.
However, an inverse inequality holds on finite spaces $X$ with a constant depending on $Q$. More specifically, it can be shown that with the definition $\alpha _{Q}:=\min _{x\in X:Q(x)>0}Q(x)$ we have for any measure $P$ which is absolutely continuous to $Q$
    ${\frac {1}{2}}D_{\mathrm {KL} }(P\parallel Q)\leq {\frac {1}{\alpha _{Q}}}\delta (P,Q)^{2}.$
As a consequence, if $Q$ has full support (i.e. $Q(x)>0$ for all $x\in X$), then
    $\delta (P,Q)^{2}\leq {\frac {1}{2}}D_{\mathrm {KL} }(P\parallel Q)\leq {\frac {1}{\alpha _{Q}}}\delta (P,Q)^{2}.$

## Proof of Pinsker’s inequality

Lemma 1.1 (Pinsker’s inequality) Let $P$ and $Q$ be two distributions defined on the universe $U$. Then, $D(P||Q)\geq {\frac {1}{2\ln 2}}\cdot ||P-Q||_{1}^{2}.$
Proof: A special case:
$P={\begin{cases}1,&{\text{w.p. }}p\\0,&{\text{w.p. }}1-p\end{cases}}$
and,
$Q={\begin{cases}1,&{\text{w.p. }}q\\0,&{\text{w.p. }}1-q\end{cases}}$
We assume $p\geq q$ (other case is similar), and let
$f(p,q)=p\log {\frac {p}{q}}+(1-p)\log {\frac {1-p}{1-q}}-{\frac {1}{2\ln 2}}(2(p-q))^{2}.$
Since
${\frac {\partial f}{\partial q}}=-{\frac {p-q}{\ln 2}}\left({\frac {1}{q(1-q)}}-4\right)\leq 0,$
and $f=0$ when $q=p$, we conclude that $f(p,q)\geq 0$ where $q\leq p.$ Thus we have that $D(P||Q)\geq {\tfrac {1}{2\ln 2}}||P-Q||_{1}^{2}$ for this special case.
General case: Let $P$ and $Q$ be distributions on $U.$ Let $A\subset U$ be
$A=\{x|p(x)\geq q(x)\}.$
and $P_{A}$ and $Q_{A}$ be
$P_{A}={\begin{cases}1,&{\text{w.p. }}\sum \limits _{x\in A}p(x)\\0,&{\text{w.p. }}\sum \limits _{x\not \in A}p(x)\end{cases}}$
$Q_{A}={\begin{cases}1,&{\text{w.p. }}\sum \limits _{x\in A}q(x)\\0,&{\text{w.p. }}\sum \limits _{x\not \in A}q(x)\end{cases}}$
Then,
${\begin{aligned}||P-Q||_{1}&=\sum \limits _{x}|p(x)-q(x)|\\&=\sum \limits _{x\in A}(p(x)-q(x))+\sum \limits _{x\notin A}(q(x)-p(x))\\&=\left|\sum \limits _{x\in A}p(x)-\sum \limits _{x\notin A}q(x)\right|+\left|\left(1-\sum \limits _{x\in A}p(x)\right)-\left(1-\sum \limits _{x\notin A}q(x)\right)\right|\\||P-Q||_{1}&=||P_{A}-Q_{A}||_{1}&{\text{(1)}}\end{aligned}}$
Define a random variable $Z$ as $Z={\begin{cases}1,&{\text{if }}x\in A\\0,&{\text{if }}x\notin A\end{cases}}.$ We have that$D(P||Q)=D(P(Z)||Q(Z))+D(P||Q|Z).$ Since $D(P(Z)||Q(Z))=D(P_{A}||Q_{A})$ and $D(P||Q|Z)\geq 0,$ we have
${\begin{aligned}D(P||Q)&\geq D(P_{A}|\ Q_{A})\\&\geq {\frac {1}{2\ln 2}}\cdot ||P_{A}-Q_{A}|{|_{1}}^{2}&{\text{(use the special case)}}\\&={\frac {1}{2\ln 2}}\cdot ||P-Q|{|_{1}}^{2}&{\text{(use equation 1)}}\end{aligned}}$