AFTD Auto-Formalizing Theoretical Domains

shannon_entropy

def

shannon_entropy P is the Shannon entropy of a discrete distribution P on a finite type Y, defined as ∑_y Real.negMulLog (P y).

Statement

noncomputable def shannon_entropy {Y : Type*} [Fintype Y] (P : Y → ℝ) : ℝ
Defined in
Cover and Thomas, Elements of Information Theory
Verified
03 Nov 2026
Axioms
none listed
Used by 2
  • ccz_renyi_entropyFor a real order α and a simple graph G on a finite type V, ccz_renyi_entropy α G is the order-α Rényi entropy of the CCZ induced-edge…
  • three_deletion_entropyFor a natural number n and a binary word w : Fin n → Bool, three_deletion_entropy n w is the real number defined as shannon_entropy…

Read back from the Lean

Given a finite type Y and a function P : Y → ℝ, shannon_entropy P is defined as the sum over all y : Y of Real.negMulLog (P y).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- Shannon entropy of a discrete probability distribution P on a finite type. -/
noncomputable def shannon_entropy {Y : Type*} [Fintype Y] (P : Y → ℝ) : ℝ := ∑ y, Real.negMulLog (P y)
See it in the graphDiscuss this resultChallenge it