Documentation

MIPRE.Foundations.LowDegree.SchwartzZippel

The Schwartz–Zippel lemma, in the form the low-degree machinery uses #

Blueprint lem:schwartz-zippel: two unequal polynomials f, g : 𝔽_q^m β†’ 𝔽_q of total degree at most d agree at a uniformly random point with probability at most d / q.

Mathlib proves the lemma for a single nonzero polynomial and a product of arbitrary finite subsets (MvPolynomial.schwartz_zippel_totalDegree, schwartz_zippel_sum_degreeOf). Everything here is the specialization the paper and the blueprint actually quote:

Three forms, because three different consumers want three different shapes:

The β„šβ‰₯0-valued intermediate is kept private: it is Mathlib's shape, not ours.

def MIPRE.LowDegree.agree {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {m : β„•} (f g : MvPolynomial (Fin m) F) :
Finset (Fin m β†’ F)

The points of 𝔽_q^m at which two polynomials agree.

Equations
Instances For
    @[simp]
    theorem MIPRE.LowDegree.mem_agree {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {m : β„•} {f g : MvPolynomial (Fin m) F} {x : Fin m β†’ F} :
    theorem MIPRE.LowDegree.agree_eq_filter {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {m : β„•} (f g : MvPolynomial (Fin m) F) :
    agree f g = {x ∈ Fintype.piFinset fun (x : Fin m) => Finset.univ | (MvPolynomial.eval x) (f - g) = 0}

    agree f g is the zero set of f - g, in the shape Mathlib's lemma states.

    theorem MIPRE.LowDegree.nnrat_prob_agree_le {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {m : β„•} {f g : MvPolynomial (Fin m) F} (hfg : f β‰  g) :
    ↑(agree f g).card / ↑(Fintype.card F) ^ m ≀ ↑(f - g).totalDegree / ↑(Fintype.card F)

    The β„šβ‰₯0-valued bound, straight from Mathlib, with the denominators evaluated.

    theorem MIPRE.LowDegree.prob_agree_le_totalDegree {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {m : β„•} {f g : MvPolynomial (Fin m) F} (hfg : f β‰  g) {d : β„•} (hf : f.totalDegree ≀ d) (hg : g.totalDegree ≀ d) :
    ↑(agree f g).card / ↑(Fintype.card F) ^ m ≀ ↑d / ↑(Fintype.card F)

    Schwartz–Zippel (blueprint lem:schwartz-zippel): two unequal polynomials of total degree at most d in m variables over a finite field of size q agree at a uniformly random point of 𝔽_q^m with probability at most d / q.

    theorem MIPRE.LowDegree.prob_agree_le_individualDegree {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {m : β„•} {f g : MvPolynomial (Fin m) F} (hfg : f β‰  g) {d : β„•} (hf : βˆ€ (i : Fin m), MvPolynomial.degreeOf i f ≀ d) (hg : βˆ€ (i : Fin m), MvPolynomial.degreeOf i g ≀ d) :
    ↑(agree f g).card / ↑(Fintype.card F) ^ m ≀ ↑m * ↑d / ↑(Fintype.card F)

    The individual-degree variant: if f β‰  g and both have degree at most d in each of the m variables separately, they agree with probability at most m * d / q.

    theorem MIPRE.LowDegree.eq_of_majority_agree {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {m : β„•} {f g : MvPolynomial (Fin m) F} {d : β„•} (hf : βˆ€ (i : Fin m), MvPolynomial.degreeOf i f ≀ d) (hg : βˆ€ (i : Fin m), MvPolynomial.degreeOf i g ≀ d) (hsize : 2 * (m * d) ≀ Fintype.card F) (hmajority : Fintype.card F ^ m < 2 * (agree f g).card) :
    f = g

    The majority test used by the classical PCP. If the field has at least 2 * m * d elements, agreement at more than half the points forces polynomial equality. The strict acceptance threshold is essential when the field-size bound is an equality.

    theorem MIPRE.LowDegree.eq_of_majority_subset {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {m : β„•} {f g : MvPolynomial (Fin m) F} {d : β„•} (hf : βˆ€ (i : Fin m), MvPolynomial.degreeOf i f ≀ d) (hg : βˆ€ (i : Fin m), MvPolynomial.degreeOf i g ≀ d) (hsize : 2 * (m * d) ≀ Fintype.card F) (S : Finset (Fin m β†’ F)) (hS : βˆ€ x ∈ S, (MvPolynomial.eval x) f = (MvPolynomial.eval x) g) (hmajority : Fintype.card F ^ m < 2 * S.card) :
    f = g

    A verifier may impose other tests as well: agreement on any accepted set larger than half the field cube already forces the same identity.

    theorem MIPRE.LowDegree.card_agree_le_of_natDegree {F : Type u_1} [Field F] [Fintype F] [DecidableEq F] {p q : Polynomial F} (hpq : p β‰  q) {d : β„•} (hp : p.natDegree ≀ d) (hq : q.natDegree ≀ d) :

    The univariate case, as a count: two unequal polynomials of degree at most d over a field agree at no more than d points. This is the form lem:lidt-sync-transfer uses.