Documentation

MIPRE.Foundations.LowDegree.Anticomm

When is a Pauli-test question tuple anticommuting? #

The Pauli basis test samples ω = (u_X, u_Z, r_X, r_Z) and the two Pauli operators it asks about commute or anticommute according to whether

γ(ω) = tr_{q → 2} \bigl( (r_X · ind_m(u_X)) · (r_Z · ind_m(u_Z)) \bigr)

vanishes. The paper's fact:omega-anticomm-prob says each case has probability at least (1 - 3md/q)/2; this file is that fact.

ind_m(x) ∈ 𝔽_q^{2^m} is the vector of the subcube indicator polynomials of MIPRE/Foundations/LowDegree/Encoding.lean evaluated at an arbitrary point x, and the dot product of two of them is one low-degree encoding evaluated at the other point (indPair_eq_eval). So the fact is Schwartz--Zippel --- the encoding is a nonzero polynomial, because ind_m(x) is never the zero vector (sum_indVec, whose value is 1) --- together with the count of r in the kernel of a nonzero 𝔽-linear functional (card_filter_ker_mul).

Two departures from the paper, both recorded in the blueprint's comments on the fact:

The indicator vector at an arbitrary point #

noncomputable def MIPRE.LowDegree.indVec {K : Type u_1} [CommRing K] {m : ℕ} (x : Fin m → K) :
(Fin m → Bool) → K

ind_m(x), the vector of the subcube indicator polynomials evaluated at x. For a subcube point this is the standard basis vector at that point (eval_ind); the definition is what the Pauli basis test uses at a general x ∈ 𝔽_q^m.

Equations
Instances For
    theorem MIPRE.LowDegree.indVec_apply {K : Type u_1} [CommRing K] {m : ℕ} (x : Fin m → K) (y : Fin m → Bool) :
    indVec x y = ∏ i : Fin m, if y i = true then x i else 1 - x i
    theorem MIPRE.LowDegree.sum_indVec {K : Type u_1} [CommRing K] {m : ℕ} (x : Fin m → K) :
    ∑ y : Fin m → Bool, indVec x y = 1

    ind_m(x) has coordinate sum 1, hence is never the zero vector: the sum telescopes to ∏_i (x_i + (1 - x_i)) = 1. This is the observation the paper's \cnote adds, and it is what makes the case distinction on u_X = 0 unnecessary.

    theorem MIPRE.LowDegree.indVec_ne_zero {K : Type u_1} [CommRing K] {m : ℕ} [Nontrivial K] (x : Fin m → K) :
    noncomputable def MIPRE.LowDegree.indPair {K : Type u_1} [CommRing K] {m : ℕ} (x z : Fin m → K) :
    K

    The dot product ind_m(x) · ind_m(z), which is the γ of the Pauli basis test up to the scalars r_X r_Z and the trace.

    Equations
    Instances For
      theorem MIPRE.LowDegree.indPair_eq_eval {K : Type u_1} [CommRing K] {m : ℕ} (x z : Fin m → K) :

      The pairing is one low-degree encoding evaluated at the other point. This is the identity the paper's proof opens with, and it is what puts Schwartz--Zippel in reach.

      theorem MIPRE.LowDegree.ldEnc_indVec_ne_zero {K : Type u_1} [CommRing K] {m : ℕ} [Nontrivial K] (x : Fin m → K) :

      The kernel of a nonzero linear functional #

      The kernel-index count is about a finite 𝔽-vector space, not about a field extension: the proof uses only the module structure and a vector off the kernel. It is stated that way because the Weyl operators of MIPRE/Foundations/Weyl.lean need it on n → 𝔽, where the phase (-1)^{tr(a · b)} is summed over a whole register rather than over a single field element. The field-extension form below is the instance V = K.

      theorem MIPRE.LowDegree.card_filter_ker_mul' {F : Type u_1} {V : Type u_2} [Field F] [Fintype F] [DecidableEq F] [AddCommGroup V] [Module F V] [Fintype V] (τ : V →ₗ[F] F) (hτ : τ ≠ 0) :
      {r : V | τ r = 0}.card * Fintype.card F = Fintype.card V

      A nonzero 𝔽-linear functional on a finite 𝔽-vector space has kernel of index |𝔽|. Every fibre is a translate of the kernel, and there are |𝔽| of them.

      theorem MIPRE.LowDegree.card_filter_ker_mul {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [Algebra F K] (τ : K →ₗ[F] F) (hτ : τ ≠ 0) :
      {r : K | τ r = 0}.card * Fintype.card F = Fintype.card K

      A nonzero 𝔽-linear functional has kernel of index |𝔽|: card_filter_ker_mul' at V = K.

      theorem MIPRE.LowDegree.card_filter_trace_mul {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [Algebra F K] [FiniteDimensional F K] [Algebra.IsSeparable F K] (c : K) (hc : c ≠ 0) :
      {r : K | (Algebra.trace F K) (c * r) = 0}.card * Fintype.card F = Fintype.card K

      The trace against a fixed nonzero element is a nonzero functional, so its kernel is again of index |𝔽|.

      The fact #

      theorem MIPRE.LowDegree.two_mul_card_filter_trace_ne {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [Algebra F K] [FiniteDimensional F K] [Algebra.IsSeparable F K] (hF : Fintype.card F = 2) (c : K) (hc : c ≠ 0) :
      2 * {r : K | (Algebra.trace F K) (c * r) ≠ 0}.card = Fintype.card K

      Over 𝔽₂, exactly half the field is off the kernel.

      noncomputable def MIPRE.LowDegree.acGamma {K : Type u_2} [Field K] {m : ℕ} (F : Type u_3) [Field F] [Algebra F K] (uX uZ : Fin m → K) (rX rZ : K) :
      F

      γ(ω), the quantity of the Pauli basis test whose vanishing says that the two Pauli operators of the tuple ω = (u_X, u_Z, r_X, r_Z) commute: the trace of the dot product of r_X · ind_m(u_X) with r_Z · ind_m(u_Z).

      Equations
      Instances For
        noncomputable def MIPRE.LowDegree.acTuples {K : Type u_2} [Field K] [Fintype K] (F : Type u_3) [Field F] [Fintype F] [DecidableEq F] [Algebra F K] (m : ℕ) :
        Finset ((Fin m → K) × (Fin m → K) × K × K)

        The anticommuting tuples, as a Finset of the sample space.

        Equations
        Instances For
          noncomputable def MIPRE.LowDegree.cTuples {K : Type u_2} [Field K] [Fintype K] (F : Type u_3) [Field F] [Fintype F] [DecidableEq F] [Algebra F K] (m : ℕ) :
          Finset ((Fin m → K) × (Fin m → K) × K × K)

          The commuting tuples.

          Equations
          Instances For
            theorem MIPRE.LowDegree.two_mul_card_pair {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [DecidableEq K] [Algebra F K] [FiniteDimensional F K] [Algebra.IsSeparable F K] {m : ℕ} (hF : Fintype.card F = 2) (uX uZ : Fin m → K) (hp : indPair uX uZ ≠ 0) :
            2 * {c : K × K | acGamma F uX uZ c.1 c.2 ≠ 0}.card = (Fintype.card K - 1) * Fintype.card K

            At a nonzero pairing value, half the (r_X, r_Z) with r_X ≠ 0 are anticommuting.

            theorem MIPRE.LowDegree.card_acTuples_eq {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [Algebra F K] {m : ℕ} :
            (acTuples F m).card = ∑ uX : Fin m → K, ∑ uZ : Fin m → K, {c : K × K | acGamma F uX uZ c.1 c.2 ≠ 0}.card

            The anticommuting count, one question pair at a time.

            The Schwartz--Zippel step #

            theorem MIPRE.LowDegree.card_indPair_eq_zero_mul_le {K : Type u_2} [Field K] [Fintype K] [DecidableEq K] {m : ℕ} (uX : Fin m → K) :
            ↑{uZ : Fin m → K | indPair uX uZ = 0}.card * ↑(Fintype.card K) ≤ ↑m * ↑(Fintype.card K) ^ m

            The pairing vanishes at few u_Z. ind_m(u_X) is a nonzero vector, so its low-degree encoding is a nonzero multilinear polynomial and Schwartz--Zippel costs m/q, not md/q.

            The two counts #

            theorem MIPRE.LowDegree.le_two_mul_card_acTuples {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [Algebra F K] {m : ℕ} (hF : Fintype.card F = 2) :
            (↑(Fintype.card K) - 1) * (↑(Fintype.card K) - ↑m) * ↑(Fintype.card K) ^ (2 * m) ≤ 2 * ↑(acTuples F m).card

            The anticommuting pairs (r_X, r_Z) are at least half of those with r_X ≠ 0, and the pairing is nonzero for all but a m/q fraction of the u_Z.

            theorem MIPRE.LowDegree.two_mul_card_filter_trace_eq {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [Algebra F K] [FiniteDimensional F K] [Algebra.IsSeparable F K] (hF : Fintype.card F = 2) (c : K) (hc : c ≠ 0) :
            2 * {r : K | (Algebra.trace F K) (c * r) = 0}.card = Fintype.card K

            Over 𝔽₂, exactly half the field is in the kernel.

            theorem MIPRE.LowDegree.le_two_mul_card_pair_c {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [DecidableEq K] [Algebra F K] [FiniteDimensional F K] [Algebra.IsSeparable F K] {m : ℕ} (hF : Fintype.card F = 2) (uX uZ : Fin m → K) :
            (Fintype.card K - 1) * Fintype.card K ≤ 2 * {c : K × K | acGamma F uX uZ c.1 c.2 = 0}.card

            The same lower bound for the commuting pairs, and this time at every (u_X, u_Z): when the pairing vanishes every pair is commuting, and otherwise the r_X ≠ 0 pairs already supply half of (q-1) q.

            theorem MIPRE.LowDegree.card_cTuples_eq {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [Algebra F K] {m : ℕ} :
            (cTuples F m).card = ∑ uX : Fin m → K, ∑ uZ : Fin m → K, {c : K × K | acGamma F uX uZ c.1 c.2 = 0}.card
            theorem MIPRE.LowDegree.le_two_mul_card_cTuples {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [Algebra F K] {m : ℕ} (hF : Fintype.card F = 2) :
            (↑(Fintype.card K) - 1) * ↑(Fintype.card K) ^ (2 * m + 1) ≤ 2 * ↑(cTuples F m).card
            theorem MIPRE.LowDegree.card_acTuples_add_card_cTuples {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [Algebra F K] {m : ℕ} :
            (acTuples F m).card + (cTuples F m).card = Fintype.card K ^ (2 * m + 2)

            The two cases partition the sample space. This is what makes the pair of bounds below informative rather than merely true: they add to at least 1 - (m+2)/q, so neither set can be much more than half, and in particular neither is everything.

            The fact #

            theorem MIPRE.LowDegree.prob_anticommuting_ge_sharp {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [Algebra F K] {m : ℕ} (hF : Fintype.card F = 2) :
            (1 - (↑m + 1) / ↑(Fintype.card K)) / 2 ≤ ↑(acTuples F m).card / ↑(Fintype.card K) ^ (2 * m + 2)

            fact:omega-anticomm-prob, sharp form: an anticommuting tuple has probability at least (1 - (m+1)/q)/2.

            theorem MIPRE.LowDegree.prob_commuting_ge_sharp {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [Algebra F K] {m : ℕ} (hF : Fintype.card F = 2) :
            (1 - 1 / ↑(Fintype.card K)) / 2 ≤ ↑(cTuples F m).card / ↑(Fintype.card K) ^ (2 * m + 2)

            fact:omega-anticomm-prob, commuting case: a commuting tuple has probability at least (1 - 1/q)/2, with no m at all.

            theorem MIPRE.LowDegree.prob_anticommuting_ge {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [Algebra F K] {m d : ℕ} (hF : Fintype.card F = 2) (hm : 1 ≤ m) (hd : 1 ≤ d) :
            (1 - 3 * ↑m * ↑d / ↑(Fintype.card K)) / 2 ≤ ↑(acTuples F m).card / ↑(Fintype.card K) ^ (2 * m + 2)

            fact:omega-anticomm-prob in the paper's shape: both cases have probability at least (1 - 3md/q)/2. The hypotheses 1 ≤ m and 1 ≤ d are what makes m + 1 ≤ 3md; the sharp forms above need neither.

            theorem MIPRE.LowDegree.prob_commuting_ge {F : Type u_1} {K : Type u_2} [Field F] [Fintype F] [DecidableEq F] [Field K] [Fintype K] [Algebra F K] {m d : ℕ} (hF : Fintype.card F = 2) (hm : 1 ≤ m) (hd : 1 ≤ d) :
            (1 - 3 * ↑m * ↑d / ↑(Fintype.card K)) / 2 ≤ ↑(cTuples F m).card / ↑(Fintype.card K) ^ (2 * m + 2)

            The commuting case in the paper's shape.