Documentation

CsdLean4.Mathlib.InformationTheory.FiniteEntropy

Shannon entropy on a finite type, and the H-theorem in entropy form #

Category: 1-Mathlib (CSD-free; staged as a Mathlib-upstream candidate). BACKLOG #110, the residue #109 named.

Mathlib has the Kullback–Leibler divergence but no Shannon entropy of a measure — not for a finite type, not anywhere. #109 proved the arrow of time in its divergence form, which is the general one; this file supplies the identity that turns it into the textbook statement, and the two classical consequences.

What is proved #

Honest scope #

⚠️ The uniform reference is not optional. Entropy increases along a kernel that fixes the uniform law; a kernel with some other stationary law moves entropy either way, and what is monotone then is the divergence from that law (#109), not the entropy. The two statements coincide only here.

⚠️ Finite type only. measureEntropy sums over Fintype.card α point masses. Differential entropy, countable types with infinite entropy, and the conditional and joint entropies are all untouched.

⚠️ No convergence, and no rate. Monotone is not strictly increasing, and nothing says the entropy reaches log card: a kernel can be the identity.

References: T. Cover, J. Thomas, Elements of Information Theory, 2nd ed., Thm 2.6.4 (maximum entropy) and §4.4 (the H-theorem for a doubly stochastic chain); Mathlib.InformationTheory.KullbackLeibler.Basic (klDiv, llr, integral_llr_add_sub_measure_univ_nonneg = Gibbs), Mathlib.Probability.UniformOn; KlDivArrow.lean (#109's Cat-1 half).

noncomputable def InformationTheory.measureEntropy {α : Type u_1} [MeasurableSpace α] [Fintype α] (μ : MeasureTheory.Measure α) :

Shannon entropy of a measure on a finite type: −∑ p log p over the point masses.

Equations
Instances For

    Every measure on a finite type is the sum of its point masses, restricted.

    The density against the uniform law #

    ★★ The density of a law against the uniform law is card · μ{x}. This is the Radon–Nikodym computation the entropy identity runs on, and the only real work in this file.

    ★★ So the log-likelihood ratio against the uniform law is log (card · μ{x}), almost everywhere.

    The identity, and the two classical consequences #

    ★★★ The identity: the divergence from the uniform law is log card − entropy. The two correction terms in klDiv's definition vanish because both measures are probability measures.

    ★★ The maximum-entropy theorem: no law on a finite type has entropy above log card. This is Gibbs' inequality read through the identity.

    The H-theorem in entropy form #

    ★★★ The H-theorem in entropy form. Under a Markov kernel that fixes the uniform law, Shannon entropy is non-decreasing, monotonically along the whole trajectory.

    This is the classical statement, and it is #109's divergence form (antitone_klDiv_compIterate) composed with the identity: klDiv · uniform and measureEntropy move in opposite directions, and the maximum-entropy bound is what licenses stripping ENNReal.ofReal.