AFTD Auto-Formalizing Theoretical Domains

ErrorCorrectingCodes.Codeword.get_matrix_row

defimported Lean

Utility: extract row i of matrix M as a 1×k matrix.

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
def ErrorCorrectingCodes.Codeword.get_matrix_row (n k : ℕ) (M : Matrix (Fin n) (Fin k) α) (i : Fin n) :
    Matrix (Fin 1) (Fin k) α
Defined in
TCSlib, `ErrorCorrectingCodes.Codeword.get_matrix_row`
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
none listed
Used by 1

Lean source view module on GitHub

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
/-- Utility: extract row `i` of matrix `M` as a `1×k` matrix. -/
def ErrorCorrectingCodes.Codeword.get_matrix_row (n k : ℕ) (M : Matrix (Fin n) (Fin k) α) (i : Fin n) :
    Matrix (Fin 1) (Fin k) α :=
  Matrix.of (fun _ j => (M i) j)
See it in the graphDiscuss this resultChallenge it