AFTD Auto-Formalizing Theoretical Domains

binary_entropy_nats

def

The binary entropy function in natural units (nats) is -x ln x - (1 - x) ln (1 - x) with the convention 0 ln 0 = 0.

Statement

noncomputable def binary_entropy_nats (x : ℝ) : ℝ
Defined in
Nielsen & Chuang, Quantum Computation and Quantum Information, Section 11.2
Verified
12 Nov 2026
Axioms
none listed
Used by 2

Read back from the Lean

Defines binary_entropy_nats, a function from ℝ to ℝ, which maps each real number x to Real.negMulLog x + Real.negMulLog (1 - x). In terms of Mathlib's Real.log, this is -x * Real.log x + -(1 - x) * Real.log (1 - x).

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

/-- Binary Shannon entropy in natural units (nats) with the convention 0 ln 0 = 0. -/
noncomputable def binary_entropy_nats (x : ℝ) : ℝ := Real.negMulLog x + Real.negMulLog (1 - x)
See it in the graphDiscuss this resultChallenge it