161 From the \(\mathbb {F}_2\) Bernoulli Variable to KL Divergence

Thesis. An \(\mathbb {F}_2\)-valued random variable carries the identity \(X^2=X\) (the algebraic form of \(A=A\)). This idempotency directly yields the variance \(\mathrm {Var}(X)=p(1-p)=O\cdot U\), the product of the partition fractions, and the binary KL divergence is the building block of all relative entropy.

Step 1: \(\mathbb {F}_2\)-valued variable is a partition

Let \(X:\Omega \to \mathbb {F}_2=\{0,1\}\) with \(\mathrm {Im}(X)\subseteq \{0,1\}\). The preimages partition the sample space:

\begin{equation} X^{-1}(0)\cap X^{-1}(1)=\varnothing , \qquad X^{-1}(0)\cup X^{-1}(1)=\Omega . \tag{6076}\end{equation}
This is exactly the \(O\sqcup U\) partition of \(A=A\): the preimages form a disjoint cover.
Step 2: Probability normalisation is \(O+U=1\)

From \(P(\Omega )=1\) and disjointness:

\begin{equation} P\bigl (X^{-1}(0)\cup X^{-1}(1)\bigr )=1 \;\Longrightarrow \; P(X=0)+P(X=1)=1. \tag{6077}\end{equation}
This is the partition normalisation \(O+U=1\).
Step 3: Bernoulli parameter and measure

Setting \(p:=P(X=1)\), \(0\leq p\leq 1\):

\begin{equation} P(X=0)=1-p,\quad P(X=1)=p, \qquad \sum _{x\in \mathbb {F}_2}P(X=x)=(1-p)+p=1. \tag{6078}\end{equation}
The law of \(X\) is
\begin{equation} \mu _X = (1-p)\delta _0 + p\,\delta _1. \tag{6079}\end{equation}
Step 4: \(X^2=X\) gives the variance directly

In \(\mathbb {F}_2\), idempotency holds: \(0^2=0\), \(1^2=1\), so \(X^2=X\). The expectation is

\begin{equation} \mathbb {E}[X] = 0\cdot (1-p)+1\cdot p = p. \tag{6080}\end{equation}
Since \(X^2=X\):
\begin{equation} \mathbb {E}[X^2] = \mathbb {E}[X] = p. \tag{6081}\end{equation}
Therefore the variance is
\begin{equation} \mathrm {Var}(X) = \mathbb {E}[X^2]-(\mathbb {E}[X])^2 = p - p^2 = p(1-p). \tag{6082}\end{equation}
Writing \(O:=p\), \(U:=1-p\) with \(O+U=1\):
\begin{equation} \boxed {X^2=X \;\Longrightarrow \; \mathrm {Var}(X) = p(1-p) = O\cdot U.} \tag{6083}\end{equation}
The algebraic identity \(X^2=X\) (i.e. \(A=A\)) produces the variance as the product of the partition fractions. It is maximal at \(p=\tfrac {1}{2}\) (\(O=U\), maximal uncertainty) and vanishes at \(p\in \{0,1\}\) (deterministic).
Step 5: Binary KL divergence

For two Bernoulli laws \(P=(1-p,p)\) and \(Q=(1-q,q)\):

\begin{equation} D_{KL}(P\|Q) = \sum _{x\in \mathbb {F}_2}P(x)\log \frac {P(x)}{Q(x)} = p\log \frac {p}{q} + (1-p)\log \frac {1-p}{1-q}. \tag{6084}\end{equation}
By the Gibbs inequality (Jensen):
\begin{equation} D_{KL}(P\|Q)\geq 0, \qquad D_{KL}(P\|Q)=0\iff P=Q. \tag{6085}\end{equation}
This binary form is the building block of all relative entropy.
Step 6: Extension to \(\mathbb {F}_2^N\)

For distributions on \(\mathbb {F}_2^N\):

\begin{equation} D_{KL}(P\|Q) = \sum _{x\in \mathbb {F}_2^N}P(x)\log \frac {P(x)}{Q(x)}. \tag{6086}\end{equation}
For the uniform \(P(x)=2^{-N}\):
\begin{align} D_{KL}(P\|Q) &= \sum _x 2^{-N}\log \frac {2^{-N}}{Q(x)} = \sum _x 2^{-N}\bigl [-N\log 2 - \log Q(x)\bigr ] \notag \\ &= -N\log 2 - \sum _x 2^{-N}\log Q(x), \tag{6087}\end{align}

using \(\sum _x 2^{-N}(-N\log 2) = -N\log 2\cdot \sum _x 2^{-N} = -N\log 2\). The first term \(-N\log 2\) is minus the maximal entropy; the second is the cross-entropy with \(Q\).

Result
\begin{equation} \boxed { X:\Omega \to \mathbb {F}_2 \;\Rightarrow \; X^{-1}(0)\sqcup X^{-1}(1)=\Omega \;(O\sqcup U) \;\Rightarrow \; \mathrm {Var}(X)=p(1-p)=O\cdot U \;\Rightarrow \; D_{KL}. } \tag{6088}\end{equation}

The chain is:

The single algebraic fact \(X^2=X\) — the Bernoulli realisation of \(A=A\) — fixes both the variance \(p(1-p)=O\cdot U\) (maximal at \(O=U=\tfrac {1}{2}\)) and seeds the KL divergence that generates the Fisher metric, the Polyakov action, and the Ryu–Takayanagi area in the preceding sections.

161.1 KL Divergence to Fisher Metric: the Second-Order Expansion

Thesis. The Fisher–Rao metric is the second-order Taylor coefficient of the KL divergence between nearby distributions. The first-order term vanishes by normalisation, and the Hessian form \(-\sum _x P\,\partial _i\partial _j\log P\) equals the score form \(\sum _x P\,\partial _i\log P\,\partial _j\log P\) identically.

Step 1: KL between nearby distributions

Let \(P(x)=P(x;\theta )\) and \(Q(x)=P(x;\theta +d\theta )\). Then

\begin{equation} D_{KL}(\theta ,\theta +d\theta ) = \sum _x P(x;\theta )\log \frac {P(x;\theta )}{P(x;\theta +d\theta )}. \tag{6089}\end{equation}
Step 2: Taylor expansion

Expand the perturbed distribution and its logarithm:

\begin{align} P(x;\theta +d\theta ) &= P + \partial _i P\,d\theta ^i + \tfrac {1}{2}\partial _i\partial _j P\,d\theta ^i d\theta ^j + O(d\theta ^3), \tag{6090}\\ \log P(x;\theta +d\theta ) &= \log P + \partial _i\log P\,d\theta ^i + \tfrac {1}{2}\partial _i\partial _j\log P\,d\theta ^i d\theta ^j + O(d\theta ^3). \tag{6091}\end{align}
Step 3: Substitute into KL
\begin{equation} D_{KL} = -\sum _x P\,\partial _i\log P\,d\theta ^i - \tfrac {1}{2}\sum _x P\,\partial _i\partial _j\log P\,d\theta ^i d\theta ^j + O(d\theta ^3). \tag{6092}\end{equation}
Step 4: First-order term vanishes

From normalisation \(\sum _x P=1\):

\begin{equation} \partial _i\sum _x P = 0 \;\Longrightarrow \; \sum _x P\,\partial _i\log P = \sum _x \partial _i P = \partial _i\sum _x P = 0, \tag{6093}\end{equation}
using \(\partial _i P=P\,\partial _i\log P\). Hence the linear term vanishes and
\begin{equation} D_{KL} = -\tfrac {1}{2}\sum _x P\,\partial _i\partial _j\log P\, d\theta ^i d\theta ^j + O(d\theta ^3). \tag{6094}\end{equation}
Step 5: Hessian form equals score form

Compute \(\partial _i\partial _j\log P\):

\begin{equation} \partial _i\partial _j\log P = \partial _i\!\left (\frac {\partial _j P}{P}\right ) = \frac {\partial _i\partial _j P}{P} - \frac {\partial _i P\,\partial _j P}{P^2} = \frac {\partial _i\partial _j P}{P} - \partial _i\log P\,\partial _j\log P. \tag{6095}\end{equation}
Multiplying by \(P\) and summing, the first term vanishes by normalisation:
\begin{equation} \sum _x\partial _i\partial _j P = \partial _i\partial _j\sum _x P = 0, \tag{6096}\end{equation}
so
\begin{equation} \sum _x P\,\partial _i\partial _j\log P = -\sum _x P\,\partial _i\log P\,\partial _j\log P. \tag{6097}\end{equation}
Therefore the Hessian and score forms coincide:
\begin{equation} \boxed {g_{ij} := -\sum _x P\,\partial _i\partial _j\log P = \sum _x P\,\partial _i\log P\,\partial _j\log P.} \tag{6098}\end{equation}
Step 6: Fisher metric as the KL Hessian

Substituting back:

\begin{equation} \boxed {D_{KL}(\theta ,\theta +d\theta ) = \tfrac {1}{2}\,g_{ij}\,d\theta ^i d\theta ^j + O(d\theta ^3),} \tag{6099}\end{equation}
with the line element
\begin{equation} ds^2 = g_{ij}\,d\theta ^i d\theta ^j, \qquad g_{ij} = \partial _i\partial _j D_{KL}\big |_{d\theta =0}. \tag{6100}\end{equation}
The Fisher–Rao metric is the Hessian of the KL divergence at coincidence.
Result
\begin{equation} \boxed {D_{KL}\;\Longrightarrow \;g_{ij}^{\rm Fisher} = \sum _x P\,\partial _i\log P\,\partial _j\log P.} \tag{6101}\end{equation}
The KL divergence between \(P(\theta )\) and \(P(\theta +d\theta )\) has no first-order term (normalisation kills it) and a second-order term equal to \(\tfrac {1}{2}g_{ij}\,d\theta ^i d\theta ^j\), where \(g_{ij}\) is the Fisher–Rao metric. The two standard forms of \(g_{ij}\) — the negative Hessian of the log-likelihood and the score covariance — are identically equal, both following from \(\sum _x P=1\). This is the information-geometric root from which the Polyakov action, the Ryu–Takayanagi area, and the emergent Einstein geometry all descend.

161.2 Mutual Information from \(D_{\mathrm {KL}}\)

Thesis. The mutual information \(I(X;Y)\) is the Kullback–Leibler divergence between the joint distribution and the product of marginals. It measures the failure of independence — the informational analogue of the partition boundary \(\partial (O,U)\).

Step 1: KL divergence and marginals

The KL divergence is

\begin{equation} D_{\mathrm {KL}}(P\|Q) = \sum _x P(x)\log \frac {P(x)}{Q(x)}. \tag{6102}\end{equation}
For random variables \(X,Y\) with joint distribution
\begin{equation} P_{XY}(x,y) = P(X=x,Y=y), \tag{6103}\end{equation}
the marginals are
\begin{equation} P_X(x) = \sum _y P_{XY}(x,y), \qquad P_Y(y) = \sum _x P_{XY}(x,y). \tag{6104}\end{equation}
The product (independence) reference is
\begin{equation} Q(x,y) = P_X(x)P_Y(y). \tag{6105}\end{equation}
Step 2: Mutual information as \(D_{\mathrm {KL}}\)

Define the mutual information as the divergence of the joint from the product of marginals:

\begin{equation} I(X;Y) := D_{\mathrm {KL}}\!\left (P_{XY}\,\middle \|\,P_XP_Y\right ) = \sum _{x,y}P_{XY}(x,y)\log \frac {P_{XY}(x,y)}{P_X(x)P_Y(y)}. \tag{6106}\end{equation}
By the non-negativity of \(D_{\mathrm {KL}}\):
\begin{equation} I(X;Y)\geq 0, \qquad I(X;Y)=0\iff P_{XY}(x,y)=P_X(x)P_Y(y), \tag{6107}\end{equation}
i.e. \(I=0\) exactly when \(X\) and \(Y\) are independent.
Step 3: Entropy decomposition

With the Shannon entropies

\begin{equation} H(X) = -\sum _x P_X(x)\log P_X(x), \qquad H(Y) = -\sum _y P_Y(y)\log P_Y(y), \tag{6108}\end{equation}
\begin{equation} H(X,Y) = -\sum _{x,y}P_{XY}(x,y)\log P_{XY}(x,y), \tag{6109}\end{equation}
the mutual information decomposes as
\begin{equation} I(X;Y) = H(X)+H(Y)-H(X,Y) = H(X)-H(X|Y) = H(Y)-H(Y|X). \tag{6110}\end{equation}
Result

Setting \(Q=P_XP_Y\) in the KL divergence gives the mutual information:

\begin{equation} D_{\mathrm {KL}}(P\|Q) = \sum P\log \frac {P}{Q} \quad \xrightarrow {\;Q=P_XP_Y\;}\quad D_{\mathrm {KL}}\!\left (P_{XY}\,\middle \|\,P_XP_Y\right ) = I(X;Y). \tag{6111}\end{equation}
\begin{equation} \boxed {I(X;Y) = D_{\mathrm {KL}}\!\left (P_{XY}\,\middle \|\,P_XP_Y\right ) = \sum _{x,y}P_{XY}(x,y)\log \frac {P_{XY}(x,y)}{P_X(x)P_Y(y)}.} \tag{6112}\end{equation}
\begin{equation} \boxed {D_{\mathrm {KL}}\;\Longrightarrow \;I(X;Y).} \tag{6113}\end{equation}
The mutual information is the single object \(D_{\mathrm {KL}}\) evaluated on the independence reference \(Q=P_XP_Y\): it quantifies the correlation between \(X\) and \(Y\), vanishing precisely when they factorise, and decomposing into the entropy relation \(I=H(X)+H(Y)-H(X,Y)\).