AFTD Auto-Formalizing Theoretical Domains

ErrorCorrectingCodes.Codeword.hamming_ball

defimported Lean

The Hamming ball of radius $l$ around $c$: \[ B_l(c) = \{c' : d(c',c) \le l\}, \] implemented as a Finset.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
set_option linter.unusedSectionVars false in
open Set Filter Asymptotics Finset in
variable {α : Type*} [Fintype α] [Nonempty α] [DecidableEq α] [Field α] in
variable {n k : ℕ} in
@[simp]
def ErrorCorrectingCodes.Codeword.hamming_ball (l : ℕ) (c : Codeword n α) : Finset (Codeword n α)
Defined in
TCSlib, `ErrorCorrectingCodes.Codeword.hamming_ball`
Lean proof
By Allan Li, Hydroxyi (from the file's git history), from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.
Verified
07 Oct 2026
Axioms
none listed
Built on 2
Used by 13

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
set_option linter.unusedSectionVars false in
open Set Filter Asymptotics Finset in
variable {α : Type*} [Fintype α] [Nonempty α] [DecidableEq α] [Field α] in
variable {n k : ℕ} in
/-- The Hamming ball of radius `l` centred at codeword `c`: the set of codewords within Hamming distance `l` of `c`. -/
@[simp]
def ErrorCorrectingCodes.Codeword.hamming_ball (l : ℕ) (c : Codeword n α) : Finset (Codeword n α) :=
  {c' : Codeword n α | hamming_distance c' c ≤ l}.toFinset
See it in the graphDiscuss this resultChallenge it