Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ArkLib/Data/CodingTheory/ReedSolomon.lean
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ noncomputable def codewordToPoly
{deg : ℕ} {domain : ι ↪ F} (f : code domain deg) : F[X] :=
Lagrange.interpolate Finset.univ domain.toFun f

variable [Semiring F]

/-- The generator matrix of the Reed-Solomon code of degree `deg` and evaluation points `domain`. -/
def genMatrix (deg : ℕ) : Matrix (Fin deg) ι F :=
def genMatrix (deg : ℕ) [Semiring F] : Matrix (Fin deg) ι F :=
.of fun i j => domain j ^ (i : ℕ)

/-- The (parity)-check matrix of the Reed-Solomon code, assuming `ι` is finite. -/
def checkMatrix (deg : ℕ) [Fintype ι] : Matrix (Fin (Fintype.card ι - deg)) ι F :=
sorry
noncomputable def checkMatrix (deg : ℕ) [Fintype ι] [Field F] :
Matrix (Fin (Fintype.card ι - deg)) ι F :=
let P := Finset.univ.prod fun j => (X - C (domain j))
.of fun i j => domain j ^ (i : ℕ) * (P.derivative.eval (domain j))⁻¹

-- theorem code_by_genMatrix (deg : ℕ) :
-- code deg = codeByGenMatrix (genMatrix deg) := by
Expand Down