Definition 17: Binary Entropy Function #
The binary entropy function H₂ : ℝ → ℝ defined by
H₂(δ) = -δ log₂(δ) - (1 - δ) log₂(1 - δ).
Main Results #
binaryEntropy: the binary entropy functionbinaryEntropy_lt_half:H₂(δ) < 1/2forδ ∈ (0, 11/100)hammingBall: the Hamming ball of radiusrhammingBallBound:|B₀(⌊δn - 1⌋)| ≤ 2^{H₂(δ) · n}
Binary Entropy Function #
The binary entropy function H₂ : ℝ → ℝ defined by
H₂(δ) = -δ log₂(δ) - (1 - δ) log₂(1 - δ).
For δ ∈ (0, 1), this gives the Shannon entropy of a Bernoulli(δ) distribution
measured in bits. Outside (0, 1), the function extends by continuity
(with log₂(0) = 0 in Mathlib's convention).
Instances For
Key numerical inequality: H₂(11/100) < 1/2 #
The proof strategy converts the entropy inequality to a product inequality via exponentiation, then verifies the resulting natural number inequality.
H₂(11/100) < 1/2: the binary entropy function at 11/100 is less than 1/2.
The proof converts to the product form using logb, then applies key_frac_ineq.
Derivative and monotonicity of binary entropy #
binaryEntropy equals Mathlib's binEntropy divided by log 2.
H₂ is strictly increasing on (0, 1/2): for 0 < a < b < 1/2, H₂(a) < H₂(b).
This follows from H₂'(x) = logb 2 ((1-x)/x) > 0 for x < 1/2.
H₂(δ) < 1/2 for δ ∈ (0, 11/100). Since H₂ is strictly increasing on (0, 1/2)
and 11/100 < 1/2, we have H₂(δ) < H₂(11/100) < 1/2 for δ < 11/100.
Hamming Ball #
The Hamming ball of radius r centered at the origin in 𝔽₂^n:
B₀(r) = {v ∈ 𝔽₂^n : wt(v) ≤ r}, where wt is the Hamming weight.
This is defined as a Finset of vectors. When r < 0, the ball is empty.
Equations
- hammingBall n r = {v : Fin n → 𝔽₂ | ↑(hammingWeight v) ≤ r}
Instances For
Membership in the Hamming ball: v ∈ B₀(r) iff wt(v) ≤ r.
The Hamming ball is empty when r < 0.
The Hamming ball is non-empty when r ≥ 0: the zero vector has weight 0.
Hamming Ball Bound helpers #
Helper: for 0 < δ ≤ 1/2 and a ≤ k ≤ n, we have
δ^a · (1-δ)^(n-a) ≥ δ^k · (1-δ)^(n-k). This is because δ ≤ 1-δ,
so replacing a by k (moving weight from 1-δ to δ exponent) decreases the product.
Hamming Ball Bound #
The Hamming ball bound: for positive n and δ ∈ (0, 1/2],
the number of binary vectors of length n with Hamming weight at most k
satisfies |B₀(k)| ≤ 2^{H₂(δ) · n} whenever k + 1 ≤ δ · n.
The proof shows |B₀(k)| · δ^k · (1-δ)^{n-k} ≤ 1 by summing Bernoulli weights,
then converts to the entropy form.