ErrorCorrectingCodes.Codeword.finite_matrix_dist
theoremverifiedimported Lean
Finiteness of the solution set of a linear matrix equation. Let $\alpha$ be a finite field, and let $n$ and $k$ be natural numbers. Fix a codeword $v : \mathrm{Fin}\,n \to \alpha$ of length $n$ and a codeword $x : \mathrm{Fin}\,k \to \alpha$ of length $k$. Then the set of matrices $G \in \alpha^{n \times k}$ satisfying $Gx = v$ is finite.
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 m : ℕ} in theorem ErrorCorrectingCodes.Codeword.finite_matrix_dist (n k : ℕ) (v : Codeword n α) (x : Codeword k α) : Set.Finite { G : Matrix (Fin n) (Fin k) α | Matrix.mulVec G x = v }
- Source
- TCSlib, `ErrorCorrectingCodes.Codeword.finite_matrix_dist`
- Lean proof
- By Allan Li (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.ErrorCorrectingCodes.Codeword.finite_matrix_dist← ErrorCorrectingCodes.Codeword.finite_matrix_dist (TCSlib/ErrorCorrectingCodes/LinearCodes.lean:73): verbatim
- Verified
- 07 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 1
- ErrorCorrectingCodes.CodewordA codeword of length $n$ over alphabet $\alpha$ is a function $c : \mathrm{Fin}\,n \to \alpha$.
- Used by 2
- ErrorCorrectingCodes.Codeword.prob_leq_ball_sizeWeight distribution of a random linear image is dominated by a Hamming ball. Let $\alpha$ be a finite field, let $n$ and $k \ge 1$ be…
- ErrorCorrectingCodes.Codeword.matrix_dist$\mu_x(v)$ is the fraction of $n\times k$ matrices $G$ satisfying $Gx=v$.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
set_option autoImplicit true inset_option relaxedAutoImplicit true inset_option linter.unusedSectionVars false inopen Set Filter Asymptotics Finset invariable {α : Type*} [Fintype α] [Nonempty α] [DecidableEq α] [Field α] invariable {n k m : ℕ} in/-- The set of matrices `G` such that `G·x = v` is finite. -/theorem ErrorCorrectingCodes.Codeword.finite_matrix_dist (n k : ℕ) (v : Codeword n α) (x : Codeword k α) : Set.Finite { G : Matrix (Fin n) (Fin k) α | Matrix.mulVec G x = v } := by { have dist_subset : { G : Matrix (Fin n) (Fin k) α | Matrix.mulVec G x = v } ⊆ (Set.univ : Set (Matrix (Fin n) (Fin k) α)) := by intro G _ trivial have matrices_fintype : Finite ↑{G | Matrix.mulVec G x = v} := by exact Finite.Set.subset (Set.univ : Set (Matrix (Fin n) (Fin k) α)) dist_subset exact (Set.finite_coe_iff.mp matrices_fintype)}