InformationTheory

InformationTheory.Shannon.TypeClassLowerBound

source

Type-class size lower bound (Cover-Thomas) #

For a count vector c : α → ℕ with ∑ c = n, the type class T(c) := { x : Fin n → α | ∀ a, typeCount x a = c a } satisfies |T(c)| ≥ (n+1)^{-|α|} · exp(n · H(c/n)), where H(c/n) := -∑ (c(a)/n) · log(c(a)/n) is the empirical entropy.

Main definitions #

Main statements #

Implementation notes #

entropyByCount is defined directly rather than via klDivIndex with a uniform reference, since klDivIndex is asymmetric and the uniform substitution is heavy. The Real.log 0 = 0 convention makes the identity hold without a support restriction; each atom c(a) = 0 contributes 0 to both sides.

noncomputable def

InformationTheory.Shannon.entropyByCount

source
{α : Type u_1} [Fintype α] (c : α) (n : ) :

Empirical entropy of the count vector c at length n: H(c/n) := -∑ a, (c(a)/n) · log(c(a)/n).

Equations
Instances For
    Used by
      theorem

      InformationTheory.Shannon.pow_div_prod_pow_eq_exp_n_entropyByCount

      source
      {α : Type u_1} [Fintype α] {n : } (c : α) (hc_sum : a : α, c a = n) :
      n ^ n / a : α, (c a) ^ c a = Real.exp (n * entropyByCount c n)

      The bridge identity (n^n) / ∏ a, (c a)^{c a} = exp (n · H(c/n)) for ∑ c = n. Holds for all n including n = 0 (both sides equal 1).

      Used by