Documentation

MIPRE.Tailored.Intro.LinearCheck

Linear checks on answer bits, and their constraint vectors #

A tailored game's constraint is a bit vector c of length N + 1, satisfied by the answer bits z of length N when ⟨c, (z, 1)⟩ = 0 (MIPRE.Tailored.Satisfies). This file produces such vectors from linear checks: an F₂-linear functional φ on F₂^N and a target c, read as the equation φ(z) = c. The constraint of a check (LinCheck.toCon) lists the values of φ on the unit vectors, then c; satisfies_toCon_iff is the statement that it is satisfied exactly when φ(z) = c. So a decision procedure that is a conjunction of affine equations in the answer bits becomes a constraint list by writing down the functionals, with no coefficient bookkeeping: the coefficients are whatever the functional gives on the unit vectors, which a program computes by evaluating the check at those vectors.

The functionals are built from two readers: getv l, the bit at position l, and, for the effective binary field shoupBinField k hk, fldAt o, the field element whose canonical k bits start at position o (MIPRE.SAT.shoupCoordinateEquiv, under which toBits is F₂-linear). An equation E(z) = κ between field elements, E an F₂-linear map to the field, is the k checks of its coordinates (fieldChecks, forall_fieldChecks_iff).

reject is the check 0 = 1, whose constraint is rejectConstraint N.

A linear check on N answer bits: the equation φ(z) = c over F₂.

Instances For

    The answer bits as a vector of F₂^N (bits beyond the string read 0).

    Equations
    Instances For
      def MIPRE.Tailored.Intro.LinCheck.Holds {N : ℕ} (χ : LinCheck N) (v : Fin N → ZMod 2) :

      The check holds at a vector.

      Equations
      Instances For

        The constraint vector of a check: the functional on the unit vectors, then the target.

        Equations
        Instances For

          The check 0 = 1, which no vector satisfies.

          Equations
          Instances For

            The constraint of a check is satisfied exactly when the check holds.

            Readers #

            The bit at position l, 0 beyond N.

            Equations
            Instances For
              noncomputable def MIPRE.Tailored.Intro.fldAt (k : ℕ) (hk : 1 ≤ k) (N o : ℕ) :

              The field element whose canonical bits start at position o.

              Equations
              Instances For
                theorem MIPRE.Tailored.Intro.fldAt_eq {k : ℕ} {hk : 1 ≤ k} {N o : ℕ} (v : Fin N → ZMod 2) (x : (SAT.shoupBinField k hk).carrier) (h : ∀ i < k, (getv N (o + i)) v = LowDegree.ofBool (List.getD ((SAT.shoupBinField k hk).toBits x) i false)) :
                (fldAt k hk N o) v = x

                fldAt o reads the field element x when the bits from o on are those of x.

                noncomputable def MIPRE.Tailored.Intro.fieldChecks (k : ℕ) (hk : 1 ≤ k) {N : ℕ} (E : (Fin N → ZMod 2) →ₗ[ZMod 2] (SAT.shoupBinField k hk).carrier) (κ : (SAT.shoupBinField k hk).carrier) :

                The k coordinate checks of the field equation E(z) = κ.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem MIPRE.Tailored.Intro.forall_fieldChecks_iff {k : ℕ} {hk : 1 ≤ k} {N : ℕ} (E : (Fin N → ZMod 2) →ₗ[ZMod 2] (SAT.shoupBinField k hk).carrier) (κ : (SAT.shoupBinField k hk).carrier) (v : Fin N → ZMod 2) :
                  (∀ χ ∈ fieldChecks k hk E κ, χ.Holds v) ↔ E v = κ

                  The coordinate checks hold exactly when the field equation does.