Alphabeta Math
TheoremStatement: Literature-sourcedProof: AI-adaptedPipeline-generatedprecheck pass
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

Shannon bounds for finite binary codes

Statement

Let p be a finite full-support source and let H2(p) be its entropy in bits. Every finite binary uniquely decodable code C satisfies Lp(C)≥H2(p). If m≥2, the binary prefix code with lengths ℓi=⌈−log⁡2pi⌉ (called a Shannon code) has expected length strictly less than H2(p)+1. If m=1, the one-bit codeword 0 has length 1=H2(p)+1.

Facts & Assumptions

Given: A finite full-support source p=(pi)i=1m and a finite binary code C.

[F1]

Finite discrete sources and product blocks: m≥1, pi>0, and ∑ipi=1.

[F2]

Base-two entropy of a finite source: H2(p)=H(p)/ln⁡2=−∑ipilog⁡2pi.

[F3]

Finite binary source codes, extension, and expected length: Lp(C)=∑ipiℓi, and C is uniquely decodable exactly when its finite-word concatenation extension is injective.

[F4]

McMillan inequality for finite binary uniquely decodable codes: Every finite binary uniquely decodable code has ∑i2−ℓi≤1.

[F5]

Nonnegativity of finite relative entropy with a positive reference: For finite probability vectors p,q with qi>0, D(p∥q)≥0.

[F6]

Binary Kraft criterion for finite positive codeword lengths: Positive integer lengths are realized by a binary prefix code whenever their Kraft sum is at most one.

[F7]

Finite distributions, entropy, divergence, and stochastic matrices: H(p):=−∑ipiln⁡pi and D(p∥q):=∑i:pi>0piln⁡(pi/qi) when qi>0.

[F8]

Information units and logarithm-base convention: log⁡2x=ln⁡x/ln⁡2, and ln⁡2>0.

[F10]

Order, continuity, range, and the product, quotient, and reciprocal laws for the natural logarithm: For positive x,y, ln⁡(xy)=ln⁡x+ln⁡y, ln⁡(x/y)=ln⁡x−ln⁡y, and ln⁡(1/x)=−ln⁡x.

[F11]

Change of base and inversion of the positive-base real exponential: log⁡2(2u)=u for every real u.

[F12]

Ceilings give the least positive integer meeting a real threshold: ⌈x⌉=−⌊−x⌋ is an integer and x≤⌈x⌉.

[F13]

Integer part: for every real x there is exactly one integer m with m≤x<m+1: For every real y, ⌊y⌋≤y<⌊y⌋+1.

Proof

1.1F3F4givenconstruct

Let C be uniquely decodable and set K:=∑i2−ℓi>0. By [F3] and [F4], K≤1. Define qi:=2−ℓi/K; then q is a positive probability vector.

1.2F1F6F8F9F11F12givenconstructalgebra

Suppose m≥2. Full support gives 0<pi<1, so [F8] and [F9] give −log⁡2pi>0. By [F12], ℓi=⌈−log⁡2pi⌉ is a positive integer and ℓi≥−log⁡2pi. Thus log⁡2(2−ℓi)=−ℓi≤log⁡2pi by [F11]; since log⁡2 is strictly increasing by [F8] and [F9], this gives 2−ℓi≤pi and hence ∑i2−ℓi≤1. By [F6] there is a binary prefix code with these lengths.

2.1F2F3F5F7F8F9F10step 1.1givenalgebra

By [F2], [F3], [F5], [F7], [F8], and [F10], using the logarithm product and quotient laws for the integer powers in qi, 0≤D(p∥q)=∑ipiln⁡(pi/qi)=−H(p)+(ln⁡2)Lp(C)+ln⁡K. Since K≤1, [F9] gives ln⁡K≤0, so H(p)≤(ln⁡2)Lp(C)+ln⁡K≤(ln⁡2)Lp(C). Divide by ln⁡2>0 from [F8] and use [F2] to obtain H2(p)≤Lp(C).

3.1F1F2F8F9F12F13step 1.2givenalgebra∎

By [F12] and [F13], if ma=⌊−a⌋ then ma≤−a<ma+1, so a≤−ma=⌈a⌉<a+1. Therefore the Shannon code in step 1.2 satisfies Lp(C)=∑ipi⌈−log⁡2pi⌉<∑ipi(−log⁡2pi+1)=H2(p)+1. If m=1, then p1=1 by [F1], so H2(p)=0 by [F2] and [F8]–[F9]; the codeword 0 is a prefix code of length one.

Depends on

Used by

Dependency tree · two levels

42 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.

Sources