AFTD Auto-Formalizing Theoretical Domains

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.
Verified
07 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
Used by 2

Lean source view module on GitHub

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)}
See it in the graphDiscuss this resultChallenge it