Character orthogonality over a linear code
ProvedCodingTheory.codeCharacterSumLet be a finite field, let be a finite coordinate type, and let be a linear code. Let be a primitive additive character. For every word ,
This is character orthogonality over a linear code. It is a reusable finite-field form of the binary code/dual character identity stated in Chapter 5, Problem 13, and of the character relation underlying Lemma 11.
import Definitions.Def_CodingTheory import Mathlib.NumberTheory.LegendreSymbol.Complex
namespace CodingTheory
open scoped BigOperators
/-- Character orthogonality over a linear code and its dual. -/
theorem codeCharacterSum
(F ι : Type*) [Field F] [Fintype F] [DecidableEq F]
[Fintype ι] [DecidableEq ι]
(ψ : AddChar F ℂ) (hψ : ψ.IsPrimitive)
(C : LinearCode F ι) (v : Word F ι) :
letI := Fintype.ofFinite C
(v ∈ dualCode F ι C →
(∑ c : C, ψ ((dotForm F ι) (c : Word F ι) v)) = (Nat.card C : ℂ)) ∧
(v ∉ dualCode F ι C →
(∑ c : C, ψ ((dotForm F ι) (c : Word F ι) v)) = 0) := by sorry
end CodingTheory
Read-back
What the Lean code literally says, in plain math · gpt-5.6-sol
For every finite field equipped with decidable equality, every finite coordinate type equipped with decidable equality, every additive character satisfying and , and a proof that is primitive—meaning that for every nonzero , the additive character is not identically —let be any -linear subspace of the word space , and let . Define , define the dual code by , and define , where the summation is over the subtype of codewords together with their membership proofs and each such is coerced to its underlying word. The declaration asserts precisely the conjunction
where is the finite natural-number cardinality of , cast into , and the on the right is complex zero. The local finite-type structure on is obtained from its finiteness, so no enumeration of is an additional hypothesis. Both implications are asserted simultaneously: for any particular , one premise holds and the other implication is vacuous; no converse is literally stated. The coordinate type may be empty, and may be the zero code or the whole word space, although itself is never an empty set because every submodule contains the zero word. In the empty-coordinate case the word space and each have one element, every word lies in , the first equality reads , and the second implication is vacuous.
Confirmed by the mission captain (proposal self-audit).