Documentation

CslibFrontier.Logics.Propositional.Algebraic.PolynomialCalculus.Proof

Polynomial Calculus proofs #

A Polynomial Calculus proof from a list F of input polynomials is a sequence in which each line is an input, a scalar linear combination of two earlier lines, or an earlier line multiplied by a variable (Cslib.Logic.PL.PC.IsProof). Proofs are listed from their last line to their first, so that a new line is added in front. A refutation contains the polynomial 1. Proofs are sound: every line vanishes at every common zero of the inputs.

The size is the sum of the numbers of supported monomials across all lines, counting repeated lines separately. The degree is the largest total degree of a line, with value 0 for the empty proof. Polynomials are formal.

Relation to the source #

de Rezende et al., §8.1, p. 217 works over a field, with the same two rules (scalar linear combination and multiplication by a variable), the same size ∑ i, ‖p i‖ and the same degree; a refutation there ends with 1, while here it contains 1, which is equivalent after discarding the lines above it. Coefficients here lie in an arbitrary commutative semiring: the rules use only addition and multiplication. Over the trivial semiring every nonempty input list is refutable.

Proofs from the same inputs concatenate. Derivations of monomial multiples and nonzero finite linear combinations come with size and degree bounds, providing the constructions used to simulate Nullstellensatz refutations.

Main definitions #

Main results #

References #

Complexity measures #

def Cslib.Logic.PL.PC.size {V : Type u_1} {R : Type u_2} [CommSemiring R] (ls : List (MvPolynomial V R)) :

The size of a PC proof: the sum of support sizes across all lines, counting repeated lines separately.

def Cslib.Logic.PL.PC.degree {V : Type u_1} {R : Type u_2} [CommSemiring R] (ls : List (MvPolynomial V R)) :

The degree of a PC proof: the maximum total degree of a line, with value 0 for the empty list.

theorem Cslib.Logic.PL.PC.degree_le_iff {V : Type u_1} {R : Type u_2} [CommSemiring R] {ls : List (MvPolynomial V R)} {d : ℕ} :
degree ls ≤ d ↔ ∀ p ∈ ls, p.totalDegree ≤ d

A PC proof has degree at most d exactly when every line has total degree at most d.

Proofs #

inductive Cslib.Logic.PL.PC.IsProof {V : Type u_1} {R : Type u_2} [CommSemiring R] (F : List (MvPolynomial V R)) :

A Polynomial Calculus proof from F, listed from its last line to its first: every line is an input from F, a scalar linear combination of two lines below it, or a line below it multiplied by a variable.

@[simp]
theorem Cslib.Logic.PL.PC.size_nil {V : Type u_1} {R : Type u_2} [CommSemiring R] :

The empty proof has size zero.

@[simp]
theorem Cslib.Logic.PL.PC.size_cons {V : Type u_1} {R : Type u_2} [CommSemiring R] (p : MvPolynomial V R) (ls : List (MvPolynomial V R)) :
size (p :: ls) = p.support.card + size ls

Adding a line adds its size.

@[simp]
theorem Cslib.Logic.PL.PC.size_append {V : Type u_1} {R : Type u_2} [CommSemiring R] (ls ls' : List (MvPolynomial V R)) :
size (ls ++ ls') = size ls + size ls'

Sizes add under concatenation.

@[simp]
theorem Cslib.Logic.PL.PC.degree_nil {V : Type u_1} {R : Type u_2} [CommSemiring R] :

The empty proof has degree zero.

@[simp]
theorem Cslib.Logic.PL.PC.degree_cons {V : Type u_1} {R : Type u_2} [CommSemiring R] (p : MvPolynomial V R) (ls : List (MvPolynomial V R)) :

Adding a line takes the maximum of its degree and the previous proof's degree.

theorem Cslib.Logic.PL.PC.IsProof.append {V : Type u_1} {R : Type u_2} [CommSemiring R] {F ls ls' : List (MvPolynomial V R)} (h : IsProof F ls) (h' : IsProof F ls') :
IsProof F (ls ++ ls')

A proof placed above another proof from the same input system gives a proof.

theorem Cslib.Logic.PL.PC.IsProof.eval_eq_zero {V : Type u_1} {R : Type u_2} [CommSemiring R] {F ls : List (MvPolynomial V R)} (h : IsProof F ls) {x : V → R} (hx : ∀ f ∈ F, (MvPolynomial.eval x) f = 0) (p : MvPolynomial V R) :
p ∈ ls → (MvPolynomial.eval x) p = 0

Soundness. Every line of a proof vanishes at every common zero of the inputs.

theorem Cslib.Logic.PL.PC.IsProof.exists_eval_ne_zero {V : Type u_1} {R : Type u_2} [CommSemiring R] [Nontrivial R] {F ls : List (MvPolynomial V R)} (h : IsProof F ls) (h1 : 1 ∈ ls) (x : V → R) :
∃ f ∈ F, (MvPolynomial.eval x) f ≠ 0

Over nontrivial coefficients, a refutation leaves no common zero of the inputs: at every point some input does not vanish.

theorem Cslib.Logic.PL.PC.exists_isProof_monomial_mul {V : Type u_1} {R : Type u_2} [CommSemiring R] {F : List (MvPolynomial V R)} {f : MvPolynomial V R} (hf : f ∈ F) (m : V →₀ ℕ) :

A monomial multiple of an input polynomial has a PC proof of size at most (m.degree + 1) * f.support.card and degree at most f.totalDegree + m.degree. The proof starts with f and multiplies by variables.

theorem Cslib.Logic.PL.PC.exists_isProof_sum {V : Type u_1} {R : Type u_2} [CommSemiring R] {ι : Type u_3} {F : List (MvPolynomial V R)} (t : Finset ι) (p : ι → MvPolynomial V R) (a : ι → R) (w c : ι → ℕ) (d : ℕ) (hw : ∀ i ∈ t, (p i).support.card ≤ w i) (hp : ∀ i ∈ t, p i ≠ 0 → ∃ (ls : List (MvPolynomial V R)), IsProof F ls ∧ p i ∈ ls ∧ size ls ≤ c i ∧ degree ls ≤ d) (hne : ∑ i ∈ t, MvPolynomial.C (a i) * p i ≠ 0) :
∃ (ls : List (MvPolynomial V R)), IsProof F ls ∧ ∑ i ∈ t, MvPolynomial.C (a i) * p i ∈ ls ∧ size ls ≤ (∑ i ∈ t, w i) ^ 2 + ∑ i ∈ t, c i ∧ degree ls ≤ d

Derive the nonzero sum ∑ i ∈ t, C (a i) * p i in one PC proof of degree at most d and size at most (∑ i ∈ t, w i) ^ 2 + ∑ i ∈ t, c i, given support bounds w i and proofs of size at most c i and degree at most d for every nonzero p i in t.

def Cslib.Logic.PL.PC.RefutableInSize {V : Type u_1} {R : Type u_2} [CommSemiring R] (F : List (MvPolynomial V R)) (s : ℕ) :

F has a Polynomial Calculus refutation of size at most s.

def Cslib.Logic.PL.PC.RefutableInDegree {V : Type u_1} {R : Type u_2} [CommSemiring R] (F : List (MvPolynomial V R)) (d : ℕ) :

F has a Polynomial Calculus refutation of degree at most d.