@@ -8,44 +8,46 @@ import Mathlib.Algebra.Polynomial.Basic
88import Mathlib.Data.Real.Sqrt
99
1010import ArkLib.Data.CodingTheory.Basic
11+ import ArkLib.Data.Polynomial.Bivariate
1112
12- variable {F : Type } [Field F]
13-
14-
15- open Polynomial
16-
17- def coeff (p : Polynomial (Polynomial F)) (i j : ℕ) : F :=
18- (p.coeff j).coeff i
13+ namespace GuruswamiSudan
1914
15+ variable {F : Type } [Field F]
2016variable [DecidableEq F]
21-
22-
23- /- This should be true -/
24- /- lemma rootMultiplicity₀_some_implies_root {p : Polynomial (Polynomial F)} {x y : F} -/
25- /- (h0 : 0 < p.degree) -/
26- /- (h : some 0 < (rootMultiplicity₀ p)) -/
27- /- : -/
28- /- (p.eval 0).eval 0 = 0 -/
29- /- := by -/
30- /- sorry -/
31-
3217variable {n : ℕ}
3318
34- structure GuruswamiSudanCondition (k r D : ℕ) (ωs f : Fin n → F) (Q : Polynomial (Polynomial F)) where
35- Q_deg : weightedDegree Q 1 (k-1 ) ≤ D
36- Q_roots : ∀ i, (Q.eval (C <| f i)).eval (ωs i) = 0
37- Q_multiplicity : ∀ i, r = _root_.rootMultiplicity Q (ωs i) (f i)
19+ open Polynomial
3820
21+ /--
22+ Guruswami-Sudan conditions for the polynomial searched by the decoder.
23+ As in the Berlekamp-Welch case, this can be shown to be equivalent to a
24+ a system of linear equations.
25+ -/
26+ structure GuruswamiSudanCondition (k r D : ℕ) (ωs f : Fin n → F) (Q : Polynomial (Polynomial F)) where
27+ /-- Degree of the polynomial. -/
28+ Q_deg : Bivariate.weightedDegree Q 1 (k-1 ) ≤ D
29+ /-- (ωs i, f i) must be root of the polynomial Q. -/
30+ Q_roots : ∀ i, (Q.eval (C <| f i)).eval (ωs i) = 0
31+ /-- Multiplicity of the roots is equal to r. -/
32+ Q_multiplicity : ∀ i, r = Bivariate.rootMultiplicity Q (ωs i) (f i)
33+
34+ /-- Guruswami-Sudan decoder. -/
3935opaque decoder (k r D e : ℕ) (ωs f : Fin n → F) : List F[X] := sorry
4036
41- theorem decoder_mem {k r D e : ℕ} {ωs f : Fin n → F} {p : F[X]}
37+ /-- Each decoded codeword has to be e-far from the received message. -/
38+ theorem decoder_mem_impl_dist {k r D e : ℕ} {ωs f : Fin n → F} {p : F[X]}
4239 (h_in : p ∈ decoder k r D e ωs f)
4340 (h_e : e ≤ n - Real.sqrt (k * n))
4441 :
4542 Δ₀(f, p.eval ∘ ωs) ≤ e := by sorry
4643
47- theorem decoder_empty {k r D e : ℕ} {ωs f : Fin n → F} {p : F[X]}
48- (h_nil : decoder k r D e ωs f = [])
44+ /-- If a codeword is e-far from the received message it appears in the output of
45+ the decoder.
46+ -/
47+ theorem decoder_dist_impl_mem {k r D e : ℕ} {ωs f : Fin n → F} {p : F[X]}
4948 (h_e : e ≤ n - Real.sqrt (k * n))
49+ (h_dist : Δ₀(f, p.eval ∘ ωs) ≤ e)
5050 :
51- ¬∃ (p : F[X]), Δ₀(f, p.eval ∘ ωs) ≤ e := by sorry
51+ p ∈ decoder k r D e ωs f := by sorry
52+
53+ end GuruswamiSudan
0 commit comments