File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -48,15 +48,15 @@ noncomputable def codewordToPoly
4848 {deg : ℕ} {domain : ι ↪ F} (f : code domain deg) : F[X] :=
4949 Lagrange.interpolate Finset.univ domain.toFun f
5050
51- variable [Semiring F]
52-
5351/-- The generator matrix of the Reed-Solomon code of degree `deg` and evaluation points `domain`. -/
54- def genMatrix (deg : ℕ) : Matrix (Fin deg) ι F :=
52+ def genMatrix (deg : ℕ) [Semiring F] : Matrix (Fin deg) ι F :=
5553 .of fun i j => domain j ^ (i : ℕ)
5654
5755/-- The (parity)-check matrix of the Reed-Solomon code, assuming `ι` is finite. -/
58- def checkMatrix (deg : ℕ) [Fintype ι] : Matrix (Fin (Fintype.card ι - deg)) ι F :=
59- sorry
56+ noncomputable def checkMatrix (deg : ℕ) [Fintype ι] [Field F] :
57+ Matrix (Fin (Fintype.card ι - deg)) ι F :=
58+ let P := Finset.univ.prod fun j => (X - C (domain j))
59+ .of fun i j => domain j ^ (i : ℕ) * (P.derivative.eval (domain j))⁻¹
6060
6161-- theorem code_by_genMatrix (deg : ℕ) :
6262-- code deg = codeByGenMatrix (genMatrix deg) := by
You can’t perform that action at this time.
0 commit comments