The dual decoder at radius
DefinitionCertRandQROM_Supplement_decodeDualcertified-randomnesscryptographyp2o-gran-per-chapterp2o-plan-paperp2o-v1quantum-informationquery-complexityrandom-oracle-model
For a word , , let be its Hamming weight as a vector of (the number of nonzero field coordinates), and let for the degree parameter of the code. The decoder of the dual code is
This is the paper's decoder: it runs the unique decoder of the (generalized Reed–Solomon) dual code with decoding radius and returns when that decoder fails. It is the map applied by the unitary of the honest prover.
Formalization Note unfoldWeight is and decRadius k is . When several dual codewords lie within distance the definition picks one by choice; for the codes of §5.2 this never happens, because . No property of the decoder is assumed in any statement.
Definition code
import Mathlib
import Definitions.Def_CertRandQROM_Supplement_dualCode
set_option autoImplicit false
namespace CertRandQROM.Supplement
open Classical in
/-- The **unfolded Hamming weight** `hw(e)` of a folded word `e ∈ Σ^n`, `Σ = F_q^m`: the number
of nonzero field coordinates of `e` regarded as an element of `F_q^{N}`, `N = n·m`
(proof of Lemma 5.2, item 2, p.25 of arXiv:2608.31112, sha256 b75095a2…: "hw(e) denotes its
Hamming weight in `F_q^N`"). -/
noncomputable def unfoldWeight {K : Type} [Field K] {n m : ℕ} (e : Fin n → Fin m → K) : ℕ :=
(Finset.univ.filter fun p : Fin n × Fin m => e p.1 p.2 ≠ 0).card
/-- The decoding radius `τ = ⌊(k + 1)/2⌋` of `Decode_{C⊥}` (p.25 of arXiv:2608.31112). -/
def decRadius (k : ℕ) : ℕ := (k + 1) / 2
open Classical in
/-- **The dual decoder `Decode_{C⊥}`** (proof of Lemma 5.2, item 2, p.25 of Coladangelo et al.,
arXiv:2608.31112, sha256 b75095a2…): on input `z ∈ Σ^n`, run the unique decoder of `C⊥` with
decoding radius `τ`; if it returns a codeword of `C⊥` (a codeword `x ∈ C⊥` with
`hw(z − x) ≤ τ`, unfolded weight), return it, otherwise return `0`.
**Formalization Note** The specification of `GRSUniqueDecode` (p.22) is: return the codeword
within distance `τ` if one exists, else `⊥`; `Decode` maps `⊥` to `0`. The codeword is chosen
with `Classical.choose`; for the code `C_λ` it is unique, because `d_min(C⊥) = k + 2 > 2τ`
(p.26), so the choice is immaterial there. The statement of Theorem 6.6 applies this function
with `τ = decRadius k`. -/
noncomputable def decodeDual {K : Type} [Field K] [Fintype K] [DecidableEq K] {n m : ℕ}
(C : Finset (Fin n → Fin m → K)) (τ : ℕ) (z : Fin n → Fin m → K) : Fin n → Fin m → K :=
if h : ∃ x ∈ dualCode C, unfoldWeight (z - x) ≤ τ then h.choose else 0
end CertRandQROM.Supplement
Source
Coladangelo, Khurana, Mutreja, Roberts, Slote, Tal, Unconditional Certified Randomness without Structure, arXiv:2608.31112 (sha256 b75095a2…), §5.1, GRSUniqueDecode, p.22 (PDF p.24); proof of Lemma 5.2, item 2, definition of Decode_{C⊥}, pp.25–26 (PDF pp.27–28)