Generalized Hamming bound:
ProvedEssentialCodingTheory.generalized_hamming_boundLet be a finite alphabet with symbols, let , and let be a code in which any two distinct codewords differ in at least coordinates. Then the dimension of satisfies
In particular this holds for every code, i.e. every code of minimum distance exactly . Logarithms are real; the statement imposes no hypothesis or , and with the convention for or it remains true in those degenerate cases.
import Mathlib.InformationTheory.Hamming import Mathlib.Analysis.SpecialFunctions.Log.Base open Finset
namespace EssentialCodingTheory
theorem generalized_hamming_bound {α : Type*} [Fintype α] [DecidableEq α] {n d : ℕ}
(C : Finset (Fin n → α))
(hC : ∀ c₁ ∈ C, ∀ c₂ ∈ C, c₁ ≠ c₂ → d ≤ hammingDist c₁ c₂) :
Real.logb (Fintype.card α) C.card ≤
n - Real.logb (Fintype.card α)
((∑ i ∈ range ((d - 1) / 2 + 1), n.choose i * (Fintype.card α - 1) ^ i : ℕ) : ℝ) := by
sorry
end EssentialCodingTheoryRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
The statement concerns a finite alphabet , with no further structure assumed beyond being finite and having decidable equality. Write for its size. Note that may be or . The other inputs are:
- natural numbers and , with no restrictions: , and are all allowed;
- a finite set of words of length over , that is, .
The single hypothesis is that any two distinct words in have Hamming distance . Here is the number of coordinates where and differ. If this hypothesis holds for every . If has at most one element it holds for every .
Set , where is truncated natural-number subtraction, so when or . Define the natural number
In this sum, when , and . Terms with are because for them. Since the term is , .
The theorem states the real-number inequality
This logarithm follows total-function conventions:
- , so if the left side is and the claim becomes .
- When , and division by zero gives . Every term is then , and the claim reduces to .
- When and , the inequality is equivalent to .
Confirmed by the mission captain (proposal self-audit).