Documentation

LeanPool.Sundogcert.RSCertificate

The Reed–Solomon evaluation certificate — the interpolation-dual of the syndrome certificate #

A third instance of Sundogcert.Certificate's discipline: machine-check the deductive cheap-CHECK core, name the imported hard-FIND wall. The syndrome certificate views a code through its parity-check / coset; this views the same Reed–Solomon code through its evaluation face: a codeword is the evaluation vector i ↦ f(xᵢ) of a degree-<k polynomial f at n distinct nodes.

The one imported analytic input #

Polynomial.eq_of_natDegree_lt_card_of_eval_eq (a domain polynomial of degree < #points vanishing there is zero) + det_vandermonde_ne_zero_iff. A field discharges [CommRing]+[IsDomain].

References #

structure Sundog.RSCertificate.RSScheme (F : Type u_2) [Field F] :
Type u_2

A Reed–Solomon scheme: n DISTINCT nodes, message-degree bound k, decode radius τ. Trust surface: hnodes (node distinctness — itself cheaply certifiable, below).

  • n :

    Block length: the number of evaluation nodes.

  • k :

    Message-degree bound: codewords are evaluations of polynomials of degree < k.

  • τ :

    Decode radius: at most τ disagreements are tolerated.

  • nodes : Fin self.nF

    The evaluation nodes (must be distinct, see hnodes).

  • Node distinctness: the nodes are pairwise distinct.

Instances For
    def Sundog.RSCertificate.encode {F : Type u_1} [Field F] (S : RSScheme F) (f : Polynomial F) :
    Fin S.nF

    The codeword of a message polynomial: its evaluation vector at the nodes.

    Equations
    Instances For
      def Sundog.RSCertificate.agree {F : Type u_1} [Field F] [DecidableEq F] (S : RSScheme F) (f : Polynomial F) (y : Fin S.nF) :

      The positions where a polynomial's codeword agrees with a received word y.

      Equations
      Instances For
        theorem Sundog.RSCertificate.mem_agree {F : Type u_1} [Field F] [DecidableEq F] (S : RSScheme F) {f : Polynomial F} {y : Fin S.nF} {i : Fin S.n} :
        i agree S f y Polynomial.eval (S.nodes i) f = y i
        def Sundog.RSCertificate.Decodes {F : Type u_1} [Field F] [DecidableEq F] (S : RSScheme F) (f : Polynomial F) (y : Fin S.nF) :

        f is a valid decoding of y: degree <k, at most τ disagreements (n ≤ #agree + τ).

        Equations
        Instances For
          def Sundog.RSCertificate.Safe {F : Type u_1} [Field F] [DecidableEq F] (S : RSScheme F) (y : Fin S.nF) :

          Semantic safety: the received word has a valid decoding.

          Equations
          Instances For
            theorem Sundog.RSCertificate.rs_unique {F : Type u_1} [Field F] (S : RSScheme F) {p q : Polynomial F} {s : Finset (Fin S.n)} (hp : p.natDegree < S.k) (hq : q.natDegree < S.k) (hk : S.k s.card) (hagree : is, Polynomial.eval (S.nodes i) p = Polynomial.eval (S.nodes i) q) :
            p = q

            CORE (cheap-check soundness) — k evaluations DETERMINE the degree-<k polynomial. Two polys of natDegree < k agreeing on a set s of ≥k distinct nodes are EQUAL, by Polynomial.eq_of_natDegree_lt_card_of_eval_eq (max deg < #s, nodes restricted to s injective). The deductive core: the evaluation map is injective on degree-<k messages.

            Node-distinctness is a one-determinant certificate. A single nonzero Vandermonde determinant cheaply certifies the scheme's trust-surface hypothesis hnodes.

            The cheap verifier and its accept-soundness. #

            structure Sundog.RSCertificate.Verifier {F : Type u_1} [Field F] [DecidableEq F] (S : RSScheme F) :
            Type u_1

            A cheap verifier: a forward decoder whose some f output carries a proof it decodes.

            • decodeOpt : (Fin S.nF)Option (Polynomial F)

              Forward decoder: optionally produce a decoding polynomial for a received word.

            • decode_sound (y : Fin S.nF) (f : Polynomial F) : self.decodeOpt y = some fDecodes S f y

              Soundness of the decoder: any returned polynomial genuinely decodes the received word.

            Instances For

              The two-valued verdict of the Reed–Solomon verifier.

              • accept : Verdict

                A decoding polynomial was exhibited.

              • quarantine : Verdict

                No decoding was found by the cheap forward decoder.

              Instances For
                @[implicit_reducible]
                Equations
                def Sundog.RSCertificate.Verifier.run {F : Type u_1} [Field F] [DecidableEq F] (S : RSScheme F) (V : Verifier S) (y : Fin S.nF) :

                accept if a decoding is exhibited; quarantine otherwise (the cheap forward check).

                Equations
                Instances For
                  theorem Sundog.RSCertificate.accept_sound {F : Type u_1} [Field F] [DecidableEq F] (S : RSScheme F) (V : Verifier S) (y : Fin S.nF) :

                  Accept-soundness (by construction). accept ⟹ Safe — the exhibited decoding IS a witness.

                  theorem Sundog.RSCertificate.unique_decoding {F : Type u_1} [Field F] [DecidableEq F] (S : RSScheme F) (hrad : 2 * S.τ + S.k S.n) (y : Fin S.nF) {p q : Polynomial F} (hp : Decodes S p y) (hq : Decodes S q y) :
                  p = q

                  UNIQUE DECODING (the quantitative half) — within the radius the decoding is THE unique one. If 2τ+k ≤ n (the unique-decoding radius 2τ ≤ n−k), two valid decodings of a word are equal. Each agrees with y in ≥ n−τ positions, so (inclusion–exclusion) they agree with EACH OTHER in ≥ n−2τ ≥ k positions — whence rs_unique. So accept returns the unique message.

                  theorem Sundog.RSCertificate.corruption_fiber_nontrivial {F : Type u_1} [Field F] [DecidableEq F] (S : RSScheme F) ( : 1 S.τ) (hn : 1 S.n) {f : Polynomial F} (hf : f.natDegree < S.k) :
                  ∃ (y₁ : Fin S.nF) (y₂ : Fin S.nF), y₁ y₂ Decodes S f y₁ Decodes S f y₂

                  CORRUPTION_FIBER_NONTRIVIAL — DETERMINE the message, LOSE the corruption. For degree-<k f and radius τ ≥ 1 (n ≥ 1), at least TWO distinct words decode to the same f: the clean codeword encode f, and encode f with one position corrupted (still τ errors). So it DETERMINES the message but LOSES which corruptions were applied — the determine/lose split, on the polynomial-evaluation core.