Coordinatewise Hamming character transform
ProvedCodingTheory.hammingCoordinateCharacterSumLet be a finite field of cardinality , let be a finite coordinate type of cardinality , and let be a primitive additive character. For every word and all ,
This identity packages the coordinatewise finite-field transform used in the complete- and Hamming-weight-enumerator identities as an independently reusable statement.
import Definitions.Def_CodingTheory import Mathlib.NumberTheory.LegendreSymbol.Complex
namespace CodingTheory
open scoped BigOperators
/-- The coordinatewise character sum that produces the MacWilliams variable transform. -/
theorem hammingCoordinateCharacterSum
(F ι : Type*) [Field F] [Fintype F] [DecidableEq F]
[Fintype ι] [DecidableEq ι]
(ψ : AddChar F ℂ) (hψ : ψ.IsPrimitive)
(c : Word F ι) (X Y : ℂ) :
(∑ v : Word F ι,
X ^ (Fintype.card ι - hammingNorm v) * Y ^ hammingNorm v *
ψ ((dotForm F ι) c v)) =
(X + ((Fintype.card F - 1 : ℕ) : ℂ) * Y) ^
(Fintype.card ι - hammingNorm c) *
(X - Y) ^ hammingNorm c := by sorry
end CodingTheory
Read-back
What the Lean code literally says, in plain math · gpt-5.6-sol
For every pair of types and , assuming that is a field equipped with a finite enumeration and decidable equality and that is equipped with a finite enumeration and decidable equality, let be an additive character—meaning and for all —which is primitive in the precise sense that, for every nonzero , the character is not the constant-one character. For every arbitrary word (with no requirement that belong to any code) and every , define . Then
The sum ranges over all functions , not over a specified code, and the argument of is the coordinatewise dot product in . Every exponent is a natural number; each subtraction in an exponent is natural-number subtraction, which is truncated at zero, although because it counts a subset of the coordinates. Likewise, is computed in before being coerced into ; the field assumptions make nontrivial, so its finite cardinality is at least two. The statement includes the case , arbitrary zero or nonzero values of and , and zero exponents, with complex natural powers using the convention , including .
Confirmed by the mission captain (proposal self-audit).