generalizedHammingWeight
For a field K and a finite index set I with [Fintype I], the r-th generalized Hamming weight generalizedHammingWeight C r of a linear code C (a K-subspace of I → K) is the infimum in ℕ of the cardinalities of the supports of all r-dimensional K-subspaces D ≤ C, where the support of D is the set of indices i : I with f i ≠ 0 for some f ∈ D.
Statement
noncomputable def generalizedHammingWeight {I K : Type*} [Fintype I] [Field K] (C : Subspace K (I → K)) (r : ℕ) : ℕ
- Defined in
- Wei 1991, 'Generalized Hamming weights for linear codes', IEEE Trans. Inform. Theory; arXiv:2611.08203 Section 2.1
- Verified
- 06 Nov 2026
- Axioms
- none listed
- Used by 2
- prm_ghw_dimension_reduction_leLet K be a finite field of order q, let e, m ≥ 1, 0 ≤ t ≤ m - 1, and h = m - t. For every 1 ≤ r ≤ k_e(h), the r-th generalized Hamming…
- prmGHWGiven a finite field K with [Field K] [Fintype K] and natural numbers d, m, and r, prmGHW K d m r is the r-th generalized Hamming weight…
Read back from the Lean
generalizedHammingWeight C r defines a natural number for a finite type I, a field K, a subspace C of I → K, and r : ℕ. It is the infimum (sInf in ℕ) of the set of cardinalities:
#{ i : I | ∃ f ∈ D, f i ≠ 0 }
ranging over all subspaces D of I → K such that D ≤ C and the dimension (Module.finrank K D) equals r.
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
/-- The r-th generalized Hamming weight of a linear code C in K^I over a finite index set I. -/ noncomputable def generalizedHammingWeight {I K : Type*} [Fintype I] [Field K] (C : Subspace K (I → K)) (r : ℕ) : ℕ := sInf { (@Finset.filter _ (fun i => ∃ f ∈ (D : Set (I → K)), f i ≠ 0) (fun _ => Classical.propDecidable _) Finset.univ).card | (D : Subspace K (I → K)) (_ : D ≤ C) (_ : Module.finrank K D = r) }