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: 10 additions & 0 deletions CompPoly/Univariate/ReedSolomon/GaoCorrectness.lean
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,16 @@ theorem decode_none_farness [Field F]
rw [Gao.decode_eq_some k D r hkn msg (Nat.le_of_not_lt hle)] at hnone
exact Option.some_ne_none _ hnone

/-- Outcome characterization: `Gao.decode` returns `none` iff the received word is beyond
the guaranteed radius `⌊(n-k)/2⌋` of every codeword (combines `decode_eq_none` and
`decode_none_farness`). -/
theorem decode_eq_none_iff [Field F]
(k : ℕ) (D : Domain F) (r : Vector F D.n) (hkn : k < D.n) :
Gao.decode k D r = none ↔
∀ msg : Vector F k, D.n - k < 2 * hammingDist r.get (encode D msg).get :=
⟨decode_none_farness k D r hkn,
fun h => decode_eq_none k D r hkn fun msg => by have := h msg; omega⟩

/-- Uniqueness: within the guaranteed-decoding radius `⌊(D.n-k)/2⌋`, two messages
whose codewords lie within that radius of `r` decode to the same polynomial. -/
theorem decode_unique [Field F] (k : ℕ) (D : Domain F) (r : Vector F D.n)
Expand Down
Loading