Finite-discrete Shannon information theory — scaffolding toward Cheng's Theorem 4 #
The information-theoretic core of Cheng, R. (2026) Theorem 4,
re-checked in ShannonInfo/ChengCCC.lean. That file machine-checks the misidentification /
forgetting lower bounds modulo two named hypotheses — the data-processing inequality
(I(T;θ) ≤ C_ctx) and Fano's inequality (P_e ≥ (H(T|θ) − 1)/log(K−1)). Mathlib has
no finite-discrete entropy and mutual-information layer (only Real.negMulLog, the binary-entropy
function, and topological entropy). It does hold the Kullback–Leibler divergence klDiv with its
data-processing inequality for pushforward measures, klDiv_map_le, in
Mathlib/InformationTheory/KullbackLeibler/DataProcessing.lean. Discharging the two hypotheses in
the discrete form used here builds a small finite-discrete information-theory library, and this
file builds it bottom-up.
Status (honest) #
Done here (all sorry-free):
- the entropy definition and its nonnegativity for a pmf (
entropy,entropy_nonneg); - mutual information of a joint pmf and its nonnegativity (
mutualInfo,mutualInfo_nonneg), via the finite Gibbs inequality (gibbs_term, fromReal.log_le_sub_one_of_pos); - joint/conditional entropy and the entropy form of MI —
I(X;Y) = H(X) − H(X|Y)(Hjoint,condEntropy,mutualInfo_eq_entropy,mutualInfo_eq_sub_condEntropy): this discharges thehCondidentity ofChengCCC.misid_lower_bound; - conditional mutual information
I(X;Z|Y),I(X;Y|Z)and their nonnegativity (condMutualInfo,condMutualInfo_nonneg,condMutualInfoZ,condMutualInfoZ_nonneg); - the two chain-rule halves
I(X;Y)+I(X;Z|Y) = I(X;(Y,Z)) = I(X;Z)+I(X;Y|Z)(mi_add_condMutualInfo,mi_add_condMutualInfoZ) and the Markov-zero step (MarkovCI,markov_condMutualInfo_zero); - the data-processing inequality
I(X;Z) ≤ I(X;Y)for a Markov chainX → Y → Z(data_processing): this is the rigorous content discharginghDPIat the chainT → c → θ; - Fano's inequality for a decoder
g : β → αwith error probabilityPe: the core boundH(X|Y) ≤ log 2 + Pe·log(K−1)(condEntropy_le_log2) and the rearranged(condEntropy μ − 1)/log(K−1) ≤ Pe(fano') — this is exactlyChengCCC'shFano. The single analytic input is the unnormalised max-entropy boundentropy_masses_le(finite Gibbs), used both for theK−1error symbols and (vianegMulLog_add_le) the binary split.
Not done here: the tight Fano constant Real.binEntropy Pe (≤ log 2) in place of
log 2; the looser log 2 is all fano'/ChengCCC consume. The tight bound
H(X | Y) ≤ h₂(Pe) + Pe log₂ (|α| - 1) is proved in the cslib-frontier library as
Cslib.Probability.PMF.conditionalEntropy_le_binEntropy_add_mul_logb,
for a deterministic estimator over a joint PMF.
ChengCCC's abstract arithmetic skeletons (misid_lower_bound, forgetting_lower_bound) still
take Fano/DPI/hCond as explicit hypotheses, but the wiring IS done: cheng_misid_bound_discharged
and cheng_forgetting_bound_discharged discharge all three against these theorems for the Markov
chain T → c → θ, leaving only the modelling setup (and, for forgetting, Cheng's informal Step-4
link hConn). No sorry is used; missing results are simply absent.
Shannon entropy of a pmf p : α → ℝ in natural-log units: H(p) = ∑ a, negMulLog (p a),
where negMulLog x = -x * log x. (Mathlib has Real.negMulLog and its analytic API, but not the
random-variable entropy/mutual-information layer this builds toward.)
Equations
- FiniteInfoTheory.entropy p = ∑ a : α, (p a).negMulLog
Instances For
Mutual information of a joint pmf, and its nonnegativity (finite Gibbs) #
A joint distribution of two finite random variables is a function μ : α → β → ℝ with
μ ≥ 0 and ∑_{a,b} μ(a,b) = 1. Its marginals are μ₁(a) = ∑_b μ(a,b) and μ₂(b) = ∑_a μ(a,b),
and the mutual information is the Kullback–Leibler divergence of μ from the product μ₁ ⊗ μ₂.
First marginal μ₁(a) = ∑_b μ(a,b) of a joint pmf μ : α → β → ℝ.
Equations
- FiniteInfoTheory.marg₁ μ a = ∑ b : β, μ a b
Instances For
Second marginal μ₂(b) = ∑_a μ(a,b) of a joint pmf μ : α → β → ℝ.
Equations
- FiniteInfoTheory.marg₂ μ b = ∑ a : α, μ a b
Instances For
Shannon mutual information of a joint pmf μ, in nats:
I(μ) = ∑_{a,b} μ(a,b) · log( μ(a,b) / (μ₁(a)·μ₂(b)) ) — the KL divergence D(μ ‖ μ₁ ⊗ μ₂).
Equations
- FiniteInfoTheory.mutualInfo μ = ∑ a : α, ∑ b : β, μ a b * Real.log (μ a b / (FiniteInfoTheory.marg₁ μ a * FiniteInfoTheory.marg₂ μ b))
Instances For
Per-term Gibbs bound x − r ≤ x · log(x / r), valid for x ≥ 0, r ≥ 0, with the proviso
that r > 0 whenever x > 0 (so log is applied to a positive argument where it matters).
This is the single analytic fact behind nonnegativity of KL divergence / mutual information.
Mutual information is nonnegative. For any joint pmf μ (nonnegative, summing to 1),
I(μ) ≥ 0. Proof: the finite Gibbs/log-sum inequality bounds each summand below by
μ(a,b) − μ₁(a)·μ₂(b), whose total is 1 − 1 = 0. This is the discharged nonnegativity half of
the data-processing inequality interface required by ChengCCC.
Entropy form of mutual information (the hCond identity) #
I(X;Y) = H(X) + H(Y) − H(X,Y) = H(X) − H(X|Y). This discharges the hCond hypothesis of
ChengCCC.misid_lower_bound (condEnt = H(T) − I(T;θ), with X = T, Y = θ). The proof splits
log(μ/(μ₁μ₂)) = log μ − log μ₁ − log μ₂ on the support and collapses each marginal sum; the only
hypothesis is nonnegativity μ ≥ 0 (the identity needs no ∑ μ = 1).
Mutual information as entropy minus conditional entropy: I(X;Y) = H(X) − H(X|Y).
This is exactly the hCond identity (condEnt = H(T) − I(T;θ) rearranged).
Conditional mutual information and the data-processing inequality #
For three finite variables (X,Y,Z) with joint pmf ν : α → β → γ → ℝ, the conditional mutual
information I(X;Z | Y) is nonnegative, and vanishes under the Markov condition X → Y → Z
(conditional independence of X and Z given Y). These are the ingredients of the
data-processing inequality I(X;Z) ≤ I(X;Y) (attempted below). The proofs reuse gibbs_term.
p(x,y) = ∑_z ν(x,y,z).
Equations
- FiniteInfoTheory.margXY ν a b = ∑ c : γ, ν a b c
Instances For
p(y,z) = ∑_x ν(x,y,z).
Equations
- FiniteInfoTheory.margYZ ν b c = ∑ a : α, ν a b c
Instances For
p(x,z) = ∑_y ν(x,y,z).
Equations
- FiniteInfoTheory.margXZ ν a c = ∑ b : β, ν a b c
Instances For
Conditional mutual information I(X;Z | Y) = ∑_{x,y,z} ν·log( ν·p(y) / (p(x,y)·p(y,z)) ).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Conditional mutual information is nonnegative, I(X;Z|Y) ≥ 0. Per Y-slice this is a KL
divergence; the finite Gibbs bound makes each summand ≥ ν − p(x,y)p(y,z)/p(y), summing to 0.
Markov condition X → Y → Z, stated as conditional independence of X and Z given Y:
ν(x,y,z)·p(y) = p(x,y)·p(y,z). (Well-posed at p(y)=0: both sides vanish there.)
Equations
- FiniteInfoTheory.MarkovCI ν = ∀ (a : α) (b : β) (c : γ), ν a b c * FiniteInfoTheory.margY ν b = FiniteInfoTheory.margXY ν a b * FiniteInfoTheory.margYZ ν b c
Instances For
Markov ⟹ I(X;Z|Y) = 0. Under the conditional-independence condition every summand's
log-argument is 1, so the conditional mutual information vanishes.
Chain rule, one half:
I(X;Y) + I(X;Z|Y) = ∑_{x,y,z} ν·log( ν / (p(x)·p(y,z)) ) = I(X;(Y,Z)). The per-term log identity
log(p(x,y)/(p(x)p(y))) + log(ν p(y)/(p(x,y)p(y,z))) = log(ν/(p(x)p(y,z))) holds on the support
(and trivially at the zeros). No Markov assumption.
Conditional mutual information I(X;Y | Z) (conditioning on the third variable).
Equations
- One or more equations did not get rendered due to their size.
Instances For
I(X;Y|Z) ≥ 0 (same finite-Gibbs proof as condMutualInfo_nonneg, conditioning on Z).
Chain rule, other half: I(X;Z) + I(X;Y|Z) = ∑_{x,y,z} ν·log( ν / (p(x)·p(y,z)) ), the same
I(X;(Y,Z)) as mi_add_condMutualInfo. No Markov assumption.
Data-processing inequality. For a Markov chain X → Y → Z (conditional independence
MarkovCI), I(X;Z) ≤ I(X;Y). Proof: the two chain-rule halves give I(X;Y) + I(X;Z|Y) = I(X;(Y,Z)) = I(X;Z) + I(X;Y|Z); Markov makes I(X;Z|Y) = 0 and I(X;Y|Z) ≥ 0. This discharges
hDPI of ChengCCC.misid_lower_bound at the Markov chain T → c → θ (with C_ctx ≥ I(c;θ)).
The other DPI direction I(X;Z) ≤ I(Y;Z) under the same Markov chain X → Y → Z. Obtained
from data_processing by reindexing the (symmetric) chain as Z → Y → X (ν' z y x = ν x y z) and
transporting through mutualInfo_comm. This is the form ChengCCC needs: with the capacity bound
I(Y;Z) ≤ C_ctx it gives I(X;Z) ≤ C_ctx (here X = T, Y = c, Z = θ).
Fano's inequality #
Setup: a finite source X : α with Fintype.card α = K, side information Y : β, joint pmf
μ : α → β → ℝ (≥ 0, summing to 1), a decoder g : β → α, and error probability
Pe = ∑_{a,b} (if a = g b then 0 else μ a b) (the joint mass off the decoder's guess). Fano bounds
the conditional entropy H(X|Y) = condEntropy μ by log 2 + Pe·log(K−1), hence (rearranged)
(condEntropy μ − 1)/log(K−1) ≤ Pe — exactly ChengCCC's hFano.
Fano core (in nats): H(X|Y) ≤ log 2 + Pe·log(K−1). Decompose condEntropy μ = ∑_b D_b
with D_b = ∑_a negMulLog(μ a b) − negMulLog(p_Y b); split off the decoded symbol g b, bound the
remaining K−1 masses by entropy_masses_le and the binary split by negMulLog_add_le. The looser
log 2 (vs. the tight binEntropy Pe) avoids Jensen and is all fano'/ChengCCC needs.
Fano's inequality (rearranged), the form ChengCCC.misid_lower_bound consumes as hFano.
For K = Fintype.card α ≥ 3, (condEntropy μ − 1) / log(K−1) ≤ Pe, with Pe the error
probability of the decoder g. Follows from condEntropy_le_log2 and log 2 ≤ 1.