@@ -8,9 +8,10 @@ import Mathlib.Algebra.Polynomial.Basic
88import Mathlib.Data.Real.Sqrt
99
1010import ArkLib.Data.CodingTheory.Basic
11+ import ArkLib.Data.CodingTheory.ReedSolomon
1112import ArkLib.Data.Polynomial.Bivariate
1213
13- namespace GuruswamiSudan
14+ namespace GuruswamiSudan
1415
1516variable {F : Type } [Field F]
1617variable [DecidableEq F]
@@ -20,55 +21,86 @@ open Polynomial
2021
2122/--
2223Guruswami-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+ As in the Berlekamp-Welch case, this can be shown to be equivalent to a
2425a system of linear equations.
2526-/
26- structure GuruswamiSudanCondition (k r D : ℕ) (ωs f : Fin n → F) (Q : Polynomial (Polynomial F)) where
27+ structure Condition
28+ (k r D : ℕ)
29+ (ωs : Fin n ↪ F)
30+ (f : Fin n → F)
31+ (Q : Polynomial (Polynomial F)) where
2732 /-- Q ≠ 0 -/
2833 Q_ne_0 : Q ≠ 0
2934 /-- Degree of the polynomial. -/
30- Q_deg : Bivariate.weightedDegree Q 1 (k-1 ) ≤ D
35+ Q_deg : Bivariate.weightedDegree Q 1 (k-1 ) ≤ D
3136 /-- (ωs i, f i) must be root of the polynomial Q. -/
3237 Q_roots : ∀ i, (Q.eval (C <| f i)).eval (ωs i) = 0
3338 /-- Multiplicity of the roots is at least r. -/
3439 Q_multiplicity : ∀ i, r ≤ Bivariate.rootMultiplicity Q (ωs i) (f i)
3540
3641/-- Guruswami-Sudan decoder. -/
37- opaque decoder (k r D e : ℕ) (ωs f : Fin n → F) : List F[X] := sorry
42+ opaque decoder (k r D e : ℕ) (ωs : Fin n ↪ F) ( f : Fin n → F) : List F[X] := sorry
3843
3944/-- Each decoded codeword has to be e-far from the received message. -/
40- theorem decoder_mem_impl_dist {k r D e : ℕ} {ωs f : Fin n → F} {p : F[X]}
41- (h_in : p ∈ decoder k r D e ωs f)
45+ theorem decoder_mem_impl_dist
46+ { k r D e : ℕ}
4247 (h_e : e ≤ n - Real.sqrt (k * n))
48+ {ωs : Fin n ↪ F}
49+ {f : Fin n → F}
50+ {p : F[X]}
51+ (h_in : p ∈ decoder k r D e ωs f)
4352 :
4453 Δ₀(f, p.eval ∘ ωs) ≤ e := by sorry
4554
46- /-- If a codeword is e-far from the received message it appears in the output of
55+ /-- If a codeword is e-far from the received message it appears in the output of
4756the decoder.
4857-/
49- theorem decoder_dist_impl_mem {k r D e : ℕ} {ωs f : Fin n → F} {p : F[X]}
58+ theorem decoder_dist_impl_mem
59+ {k r D e : ℕ}
5060 (h_e : e ≤ n - Real.sqrt (k * n))
61+ {ωs : Fin n ↪ F}
62+ {f : Fin n → F}
63+ {p : F[X]}
5164 (h_dist : Δ₀(f, p.eval ∘ ωs) ≤ e)
5265 :
53- p ∈ decoder k r D e ωs f := by sorry
66+ p ∈ decoder k r D e ωs f := by sorry
5467
68+ /-- The degree bound (a.k.a. `D_X`) for instantiation of Guruswami-Sudan
69+ in lemma 5.3 of the Proximity Gap paper.
70+ D_X(m) = (m + 1/2)√ρn.
71+ -/
5572noncomputable def proximity_gap_degree_bound (k m : ℕ) : ℕ :=
5673 let rho := (k + 1 : ℚ) / n
5774 Nat.floor ((((m : ℚ) + (1 : ℚ)/2 )*(Real.sqrt rho))*n)
5875
76+ /-- The ball radius from lemma 5.3 of the Proximity Gap paper,
77+ which follows from the Johnson bound.
78+ δ₀(ρ, m) = 1 - √ρ - √ρ/2m.
79+ -/
5980noncomputable def proximity_gap_johnson (k m : ℕ) : ℕ :=
6081 let rho := (k + 1 : ℚ) / n
6182 Nat.floor ((1 : ℝ) - Real.sqrt rho - Real.sqrt rho / (2 * m))
6283
63- /-- Lemma 5.3 from the Proximity gap paper -/
64- lemma guruswami_sudan_for_proximity_gap_existence {k m : ℕ} {ωs f : Fin n → F} :
65- ∃ Q, GuruswamiSudanCondition k m (proximity_gap_degree_bound (n := n) k m) ωs f Q := by
84+ /-- The first part of lemma 5.3 from the Proximity gap paper.
85+ Given the D_X (`proximity_gap_degree_bound`) and δ₀ (`proximity_gap_johnson`),
86+ a solution to Guruswami-Sudan system exists.
87+ -/
88+ lemma guruswami_sudan_for_proximity_gap_existence {k m : ℕ} {ωs : Fin n ↪ F} {f : Fin n → F}:
89+ ∃ Q, Condition k m (proximity_gap_degree_bound (n := n) k m) ωs f Q := by
6690 sorry
6791
68- lemma guruswami_sudan_for_proximity_gap_property {k m : ℕ} {ωs f : Fin n → F}
69- {Q : F[X][X]} {p : F[X]}
70- (h : Δ₀(f, p.eval ∘ f) ≤ proximity_gap_johnson (n := n) k m)
92+ /-- The second part of lemma 5.3 from the Proximity gap paper.
93+ For any solution Q of the Guruswami-Sudan system, and for any
94+ polynomial P ∈ RS[n, k, ρ] such that Δ(w, P) ≤ δ₀(ρ, m),
95+ we have that Y - P(X) divides Q(X, Y) in the polynomial ring
96+ F[ X ] [Y ].
97+ -/
98+ lemma guruswami_sudan_for_proximity_gap_property {k m : ℕ} {ωs : Fin n ↪ F}
99+ {f : Fin n → F}
100+ {Q : F[X][X]}
101+ {p : ReedSolomon.code ωs n}
102+ (h : Δ₀(f, (ReedSolomon.codeWordToPoly p).eval ∘ f) ≤ proximity_gap_johnson (n := n) k m)
71103 :
72- ((X : F[X][X]) - C p) ∣ Q := by sorry
104+ ((X : F[X][X]) - C (ReedSolomon.codeWordToPoly p)) ∣ Q := by sorry
73105
74- end GuruswamiSudan
106+ end GuruswamiSudan
0 commit comments