Documentation

MIPRE.Background.Tailored.Intro.PauliCons

The Pauli basis test as controlled linear constraints #

The tailored question reduction keeps the Pauli basis test's answers as the introspection kernel reads them (MIPRE.Tailored.Intro.pauliLen): a label T has count T m 1 blocks of width T k bits, each block of width k the canonical bits of an element of the effective field shoupBinField k hk, all readable at the Z-basis Pauli label and all linear otherwise (pauliRead). A tailored game may decide only by controlled linear constraints: vectors c over the answer bits of both players and an affine coordinate J, chosen from the questions and the readable bits, each satisfied when ⟨c, (a, b, 1)⟩ = 0 over F₂. This file presents the kernel's Pauli conjunct --- QLD.accepts on the decoded questions and answers --- in that form, pauliCons.

That is possible because every rule of fig:decider_pauli (QLD.pairTest) is a conjunction of F₂-affine equations in the answer bits whose coefficients are computed from the questions, and its disjunctions branch only on the questions:

An F_q-equation is the k equations of its coordinates in the canonical basis, under which the field's bit encoding is F₂-linear (MIPRE.Tailored.Intro.fieldChecks). Each check is an F₂-linear functional on the answer bits with a target (LinCheck), and its constraint is the functional on the unit vectors followed by the target (LinCheck.toCon), so pauliCons never reads the readable bits: the readable answer is the Z-basis outcome, compared and probed linearly like the others. The answer bits are read by position: the field element at block i of an answer at offset o is fldAt (o + i k), a bit is getv.

The kernel itself is rewritten in PauliConsKernel.lean. pauliCons is a structural function of the questions: the coefficients are the values of explicit field operations (multiplication by question-determined elements, the trace, coordinates) at unit vectors, and the branching is on question data only, so a polynomial-time program computes it by evaluating each check at the |a| + |b| unit vectors.

The checks of each rule #

Equal types: the bits l and L + l agree, for l < L.

Equations
Instances For
    noncomputable def MIPRE.Tailored.Intro.PauliCons.prbCheck (k : ℕ) (hk : 1 ≤ k) (N : ℕ) (r : (SAT.shoupBinField k hk).carrier) (oP oB : ℕ) :

    The probe tr(a · r) of the field element at oP is the bit at oB.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      noncomputable def MIPRE.Tailored.Intro.PauliCons.lineChecks (k : ℕ) (hk : 1 ≤ k) {M : ℕ} (N n oP oL : ℕ) (u₀ w y : Fin M → (SAT.shoupBinField k hk).carrier) :

      The line-against-point rule: the point lies on the line (a condition on the questions; if it fails, reject), and the polynomial at oL, with n + 1 coefficients, evaluated at the parameter of the point, is the point answer at oP.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        noncomputable def MIPRE.Tailored.Intro.PauliCons.pauliChecks (k : ℕ) (hk : 1 ≤ k) {M : ℕ} (N oP oQ : ℕ) (y : Fin M → (SAT.shoupBinField k hk).carrier) :

        The point probe against the full Pauli outcome at oQ: the low-degree encoding of the outcome at y, ∑_z h(z) · ind_z(y), is the point answer at oP.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          noncomputable def MIPRE.Tailored.Intro.PauliCons.conVarChecks (k : ℕ) (hk : 1 ≤ k) {M : ℕ} (N : ℕ) (i : Fin LCS.MagicSquare.layout.r) (j : Fin LCS.MagicSquare.layout.s) (ω : QLD.Omega (SAT.shoupBinField k hk).carrier M) (oC oV : ℕ) :

          The Magic Square rule, a constraint triple at oC against a variable bit at oV.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            noncomputable def MIPRE.Tailored.Intro.PauliCons.pointVarChecks (k : ℕ) (hk : 1 ≤ k) {M : ℕ} (N : ℕ) (W : QLD.Bas) (j : Fin LCS.MagicSquare.layout.s) (ω : QLD.Omega (SAT.shoupBinField k hk).carrier M) (oP oV : ℕ) :

            The Magic Square consistency rule, a point answer at oP against a variable bit at oV.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              The checks of pairTest, for answers at the offsets oA and oB: one branch per rule and orientation, [] where pairTest accepts unconditionally.

              Equations
              Instances For

                Reading the answers #

                def MIPRE.Tailored.Intro.PauliCons.Reads {N : ℕ} (v : Fin N → ZMod 2) (o : ℕ) (w : Cost.BitStr) :

                The vector v carries the bits w from position o on.

                Equations
                Instances For
                  theorem MIPRE.Tailored.Intro.PauliCons.reads_left {N : ℕ} (a b : Cost.BitStr) (hN : List.length (a ++ b) ≤ N) :
                  Reads (bitVec N (a ++ b)) 0 a
                  theorem MIPRE.Tailored.Intro.PauliCons.getD_flatten (rows : List Cost.BitStr) (w : ℕ) (hw : ∀ r ∈ rows, List.length r = w) (i l : ℕ) (hl : l < w) :
                  rows.flatten.getD (i * w + l) false = List.getD (rows.getD i []) l false
                  theorem MIPRE.Tailored.Intro.PauliCons.Reads.fld {k : ℕ} {hk : 1 ≤ k} {N : ℕ} {v : Fin N → ZMod 2} {o : ℕ} {x : (SAT.shoupBinField k hk).carrier} (h : Reads v o ((SAT.shoupBinField k hk).toBits x)) :
                  (fldAt k hk N o) v = x
                  theorem MIPRE.Tailored.Intro.PauliCons.Reads.vec {k : ℕ} {hk : 1 ≤ k} {N : ℕ} {v : Fin N → ZMod 2} {o n : ℕ} {g : Fin n → (SAT.shoupBinField k hk).carrier} (h : Reads v o ((SAT.shoupBinField k hk).vecBits g).flatten) (i : Fin n) :
                  (fldAt k hk N (o + ↑i * k)) v = g i

                  Each rule's checks hold exactly when the rule accepts #

                  theorem MIPRE.Tailored.Intro.PauliCons.bitEq_holds_iff {N : ℕ} (v : Fin N → ZMod 2) {o o' : ℕ} {b b' : ZMod 2} (h : (getv N o) v = b) (h' : (getv N o') v = b') :
                  (bitEq N o o').Holds v ↔ b = b'
                  theorem MIPRE.Tailored.Intro.PauliCons.prbCheck_holds_iff {k : ℕ} {hk : 1 ≤ k} {N : ℕ} (v : Fin N → ZMod 2) (r : (SAT.shoupBinField k hk).carrier) {oP oB : ℕ} {a : (SAT.shoupBinField k hk).carrier} {b : ZMod 2} (hP : (fldAt k hk N oP) v = a) (hB : (getv N oB) v = b) :
                  (prbCheck k hk N r oP oB).Holds v ↔ QLD.prb a r = b
                  theorem MIPRE.Tailored.Intro.PauliCons.lineChecks_iff {k : ℕ} {hk : 1 ≤ k} {M N : ℕ} (v : Fin N → ZMod 2) {n oP oL : ℕ} (u₀ w y : Fin M → (SAT.shoupBinField k hk).carrier) {f : Fin (n + 1) → (SAT.shoupBinField k hk).carrier} {a : (SAT.shoupBinField k hk).carrier} (hP : (fldAt k hk N oP) v = a) (hL : ∀ (i : Fin (n + 1)), (fldAt k hk N (oL + ↑i * k)) v = f i) :
                  (∀ χ ∈ lineChecks k hk N n oP oL u₀ w y, χ.Holds v) ↔ QLD.lowDeg u₀ w y f a = true
                  theorem MIPRE.Tailored.Intro.PauliCons.pauliChecks_iff {k : ℕ} {hk : 1 ≤ k} {M N : ℕ} (v : Fin N → ZMod 2) {oP oQ : ℕ} (y : Fin M → (SAT.shoupBinField k hk).carrier) {h : (Fin M → Bool) → (SAT.shoupBinField k hk).carrier} {a : (SAT.shoupBinField k hk).carrier} (hP : (fldAt k hk N oP) v = a) (hQ : ∀ (z : Fin M → Bool), (fldAt k hk N (oQ + ↑((Introspection.FieldTableProgram.cubeEnumeration M) z) * k)) v = h z) :
                  (∀ χ ∈ pauliChecks k hk N oP oQ y, χ.Holds v) ↔ decide ((MvPolynomial.eval y) (LowDegree.ldEnc h) = a) = true
                  theorem MIPRE.Tailored.Intro.PauliCons.conVarChecks_iff {k : ℕ} {hk : 1 ≤ k} {M N : ℕ} (v : Fin N → ZMod 2) (i : Fin LCS.MagicSquare.layout.r) (j : Fin LCS.MagicSquare.layout.s) (ω : QLD.Omega (SAT.shoupBinField k hk).carrier M) {oC oV : ℕ} {α : Fin 3 → ZMod 2} {b : ZMod 2} (hC : ∀ (l : Fin 3), (getv N (oC + ↑l)) v = α l) (hV : (getv N oV) v = b) :
                  (∀ χ ∈ conVarChecks k hk N i j ω oC oV, χ.Holds v) ↔ (decide (QLD.gam ω = 0) || decide (j ∈ LCS.MagicSquare.layout.V i) && decide (∑ l : Fin 3, α l = LCS.MagicSquare.game.b i) && decide (α (LCS.MagicSquare.cellIdx i j) = b)) = true
                  theorem MIPRE.Tailored.Intro.PauliCons.pointVarChecks_iff {k : ℕ} {hk : 1 ≤ k} {M N : ℕ} (v : Fin N → ZMod 2) (W : QLD.Bas) (j : Fin LCS.MagicSquare.layout.s) (ω : QLD.Omega (SAT.shoupBinField k hk).carrier M) {oP oV : ℕ} {a : (SAT.shoupBinField k hk).carrier} {b : ZMod 2} (hP : (fldAt k hk N oP) v = a) (hV : (getv N oV) v = b) :

                  Reading each answer format #

                  theorem MIPRE.Tailored.Intro.PauliCons.read_val {k : ℕ} {hk : 1 ≤ k} {M N : ℕ} {v : Fin N → ZMod 2} {o : ℕ} {x : (SAT.shoupBinField k hk).carrier} (h : Reads v o (QLD.PauliAnswerProgram.answerBits (SAT.shoupBinField k hk) (QLD.Answer.val x))) :
                  (fldAt k hk N o) v = x
                  theorem MIPRE.Tailored.Intro.PauliCons.read_apoly {k : ℕ} {hk : 1 ≤ k} {M N : ℕ} {v : Fin N → ZMod 2} {o : ℕ} {f : Fin (1 + 1) → (SAT.shoupBinField k hk).carrier} (h : Reads v o (QLD.PauliAnswerProgram.answerBits (SAT.shoupBinField k hk) (QLD.Answer.apoly f))) (i : Fin (1 + 1)) :
                  (fldAt k hk N (o + ↑i * k)) v = f i
                  theorem MIPRE.Tailored.Intro.PauliCons.read_dpoly {k : ℕ} {hk : 1 ≤ k} {M N : ℕ} {v : Fin N → ZMod 2} {o : ℕ} {f : Fin (M * 1 + 1) → (SAT.shoupBinField k hk).carrier} (h : Reads v o (QLD.PauliAnswerProgram.answerBits (SAT.shoupBinField k hk) (QLD.Answer.dpoly f))) (i : Fin (M * 1 + 1)) :
                  (fldAt k hk N (o + ↑i * k)) v = f i
                  theorem MIPRE.Tailored.Intro.PauliCons.read_pauliAns {k : ℕ} {hk : 1 ≤ k} {M N : ℕ} {v : Fin N → ZMod 2} {o : ℕ} {g : (Fin M → Bool) → (SAT.shoupBinField k hk).carrier} (h : Reads v o (QLD.PauliAnswerProgram.answerBits (SAT.shoupBinField k hk) (QLD.Answer.pauliAns g))) (z : Fin M → Bool) :
                  theorem MIPRE.Tailored.Intro.PauliCons.read_bit {k : ℕ} {hk : 1 ≤ k} {M N : ℕ} {v : Fin N → ZMod 2} {o : ℕ} {b : ZMod 2} (h : Reads v o (QLD.PauliAnswerProgram.answerBits (SAT.shoupBinField k hk) (QLD.Answer.bit b))) :
                  (getv N o) v = b
                  theorem MIPRE.Tailored.Intro.PauliCons.read_bitPair {k : ℕ} {hk : 1 ≤ k} {M N : ℕ} {v : Fin N → ZMod 2} {o : ℕ} {β : QLD.Bas → ZMod 2} (h : Reads v o (QLD.PauliAnswerProgram.answerBits (SAT.shoupBinField k hk) (QLD.Answer.bitPair β))) (W : QLD.Bas) :
                  (getv N (o + basIdx W)) v = β W
                  theorem MIPRE.Tailored.Intro.PauliCons.read_bitTriple {k : ℕ} {hk : 1 ≤ k} {M N : ℕ} {v : Fin N → ZMod 2} {o : ℕ} {α : Fin 3 → ZMod 2} (h : Reads v o (QLD.PauliAnswerProgram.answerBits (SAT.shoupBinField k hk) (QLD.Answer.bitTriple α))) (l : Fin 3) :
                  (getv N (o + ↑l)) v = α l

                  The checks of pairTest #

                  theorem MIPRE.Tailored.Intro.PauliCons.pairChecks_iff {k : ℕ} {hk : 1 ≤ k} {M N : ℕ} [NeZero M] (hm : M ∣ Fintype.card (SAT.shoupBinField k hk).carrier) (qx qy : QLD.Question (SAT.shoupBinField k hk).carrier M) (A B : QLD.Answer (SAT.shoupBinField k hk).carrier M 1) (hA : qx.fmtOk A = true) (hB : qy.fmtOk B = true) (v : Fin N → ZMod 2) (oA oB : ℕ) (hvA : Reads v oA (QLD.PauliAnswerProgram.answerBits (SAT.shoupBinField k hk) A)) (hvB : Reads v oB (QLD.PauliAnswerProgram.answerBits (SAT.shoupBinField k hk) B)) :
                  (∀ χ ∈ pairChecks k hk N hm qx qy oA oB, χ.Holds v) ↔ QLD.pairTest hm qx qy A B = true

                  The checks of a pair of questions hold exactly when pairTest accepts, for formatted answers read at the offsets oA and oB.

                  Equal types #

                  theorem MIPRE.Tailored.Intro.PauliCons.sameChecks_iff {N : ℕ} (L : ℕ) (a b : Cost.BitStr) (ha : List.length a = L) (hb : List.length b = L) (hN : List.length (a ++ b) ≤ N) :
                  (∀ χ ∈ sameChecks N L, χ.Holds (bitVec N (a ++ b))) ↔ a = b

                  The constraints #

                  theorem MIPRE.Tailored.Intro.PauliCons.questionOfBits_ty (k : ℕ) (hk : 1 ≤ k) [NeZero k] (hodd : Odd k) (j : ℕ) (t : QLD.Ty) (x : Cost.BitStr) :

                  The decoded question has the type it was decoded at.

                  The answer parser succeeds exactly at the label's length.

                  The kernel's endpoint validity is the label's answer length.

                  The number of readable answer bits of a Pauli label.

                  Equations
                  Instances For
                    noncomputable def MIPRE.Tailored.Intro.PauliCons.pauliCons (k : ℕ) (hk : 1 ≤ k) [NeZero k] (hodd : Odd k) (j : ℕ) (hm : 2 ^ j ∣ Fintype.card (SAT.shoupBinField k hk).carrier) (t u : QLD.Ty) (x y _aR _bR : Cost.BitStr) :

                    The controlled linear constraints of the Pauli basis test at the labels t, u and the question payloads x, y, for answers of pauliLen (2^j) k t and pauliLen (2^j) k u bits. They depend on the questions only: none of the rules reads the readable answer bits aR, bR other than linearly. Equal labels compare the two answers bit by bit; distinct labels run the checks of pairTest on the decoded questions.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      theorem MIPRE.Tailored.Intro.PauliCons.length_of_mem_pauliCons (k : ℕ) (hk : 1 ≤ k) [NeZero k] (hodd : Odd k) (j : ℕ) (hm : 2 ^ j ∣ Fintype.card (SAT.shoupBinField k hk).carrier) (t u : QLD.Ty) (x y aR bR c : Cost.BitStr) (hc : c ∈ pauliCons k hk hodd j hm t u x y aR bR) :
                      List.length c = pauliLen (2 ^ j) k t + pauliLen (2 ^ j) k u + 1

                      Every constraint has one coordinate per answer bit and one for J.

                      theorem MIPRE.Tailored.Intro.PauliCons.pauliCons_iff (k : ℕ) (hk : 1 ≤ k) [NeZero k] (hodd : Odd k) (j : ℕ) (hm : 2 ^ j ∣ Fintype.card (SAT.shoupBinField k hk).carrier) (t u : QLD.Ty) (x y a b : Cost.BitStr) (ha : List.length a = pauliLen (2 ^ j) k t) (hb : List.length b = pauliLen (2 ^ j) k u) :
                      (∀ c ∈ pauliCons k hk hodd j hm t u x y (List.take (pauliLenR k (2 ^ j) t) a) (List.take (pauliLenR k (2 ^ j) u) b), Satisfies c (a ++ b ++ [true])) ↔ QLD.accepts hm (QLD.PauliBinaryProgram.questionOfBits k hk hodd j t x) (QLD.PauliBinaryProgram.questionOfBits k hk hodd j u y) (QLD.PauliAnswerProgram.decodeBits (SAT.shoupBinField k hk) (2 ^ j) 1 t a) (QLD.PauliAnswerProgram.decodeBits (SAT.shoupBinField k hk) (2 ^ j) 1 u b) = true

                      The Pauli basis test is its controlled linear constraints. For answers of the label lengths, the constraints of pauliCons at the readable prefixes are all satisfied by the two answers followed by J = 1 exactly when the Pauli basis test accepts the decoded questions and answers, as the introspection kernel evaluates it (program_pauli_iff).