AFTD Auto-Formalizing Theoretical Domains

is_mds_code

def

For a finite field F, natural numbers n and k, a subspace C of Fin n → F has dimension k (Module.finrank F C = k) and is an MDS code if every nonzero vector v in C satisfies n - k + 1 ≤ hammingNorm v.

Statement

def is_mds_code {F : Type*} [Field F] [Fintype F] [DecidableEq F] (n k : ℕ) (C : Subspace F (Fin n → F)) : Prop
Defined in
arXiv:2610.28047 Section 2.2
Verified
21 Oct 2026
Axioms
none listed

Read back from the Lean

For a finite field F (with decidable equality), natural numbers n and k, and an F-subspace C of Fin n → F, is_mds_code n k C is defined to hold if and only if: 1. The dimension (finite rank) of C as an F-module is k, and 2. For every vector v ∈ C, if v ≠ 0, then the Hamming norm of v is at least n - k + 1 (using natural number subtraction).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- A linear code of dimension k is MDS if every nonzero codeword has Hamming weight at least n - k + 1. -/
def is_mds_code {F : Type*} [Field F] [Fintype F] [DecidableEq F] (n k : ℕ) (C : Subspace F (Fin n → F)) : Prop := Module.finrank F C = k ∧ ∀ v ∈ C, v ≠ 0 → n - k + 1 ≤ hammingNorm v
See it in the graphDiscuss this resultChallenge it