Documentation

CslibFrontier.Logics.Propositional.Algebraic.SumOfSquares.Basic

Sum-of-squares refutations and pseudo-expectations #

The sum-of-squares (Positivstellensatz) proof system refutes a system of polynomial equations f = 0, f ∈ F, over an ordered commutative ring R by exhibiting multipliers gᵢ, polynomials s₁, …, sᵣ and nonnegative weights c₁, …, cᵣ with

∑ᵢ gᵢ fᵢ + ∑ₖ cₖ sₖ ² = -1.

No common zero of F can exist, since the left-hand side is nonnegative there (SOS.RefutableInDegree.not_exists_eval_eq_zero). A refutation has degree at most d (SOS.Refutation F d) when every product gᵢ fᵢ has total degree at most d and every square sₖ ² has total degree at most d, that is 2 deg sₖ ≤ d. Over ℝ, or any ring in which every nonnegative element is a sum of squares, the weights can be absorbed into the squares; over a general ordered ring they make the system stronger. Boolean or ±1 axioms such as xᵢ ² - 1 are not built in: they are members of F, as in the algebraic encodings of parity systems (Cslib.Logic.PL.ParitySystem.toPolys). This is the degree-d sum-of-squares refutation of Barak and Steurer, lecture "The sos algorithm over general domains", Definition 1 and the remark after Theorem 2 for the constraints f ≥ 0 and -f ≥ 0, f ∈ F, with each equation used through a multiplier of arbitrary sign; products of several members of F are multiples of a single member, so they are covered by the multipliers.

The dual objects are pseudo-expectations (SOS.PseudoExpectation F d): linear maps Ẽ from polynomials to R with Ẽ 1 = 1, Ẽ (s ^ 2) ≥ 0 whenever 2 deg s ≤ d, and Ẽ (q f) = 0 for f ∈ F whenever deg (q f) ≤ d. This is the formal expectation of a degree-d pseudo-distribution that satisfies F Barak and Steurer, lecture "The sos algorithm over general domains", Definitions 5 and 7, given directly as a linear functional; the condition on F asks Ẽ (q f) = 0 for all multipliers q, not only for sums of squares. Evaluation at a common zero is one (SOS.PseudoExpectation.ofEval). Applying Ẽ to a refutation of degree at most d gives 0 + (nonnegative) = -1, so a degree-d pseudo-expectation rules out degree-d refutations (SOS.PseudoExpectation.not_refutableInDegree). This is the easy direction of the duality Barak and Steurer, lecture "The sos algorithm over general domains", Theorem 8, case f = -1 (compare Barak and Steurer, lecture "Mathematical definitions", Theorem 19 on the hypercube), and the one used by degree lower bounds. The converse, by hyperplane separation, is not formalized.

Main definitions #

Main results #

References #

structure Cslib.Logic.PL.SOS.Refutation {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] (F : List (MvPolynomial σ R)) (d : ℕ) :
Type (max u_1 u_2)

A sum-of-squares refutation of degree at most d of the polynomial equations f = 0, f ∈ F: multipliers mult i for the members of F and weighted squares squares, pairs (c, s) with c ≥ 0, such that ∑ᵢ mult i * F[i] + ∑_{(c, s)} C c * s ^ 2 = -1, with every product mult i * F[i] of total degree at most d and every square of total degree at most d.

def Cslib.Logic.PL.SOS.RefutableInDegree {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] (F : List (MvPolynomial σ R)) (d : ℕ) :

The system F has a sum-of-squares refutation of degree at most d.

RefutableInDegree F d holds exactly when a refutation of degree at most d exists.

theorem Cslib.Logic.PL.SOS.Refutation.refutableInDegree {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] {F : List (MvPolynomial σ R)} {d : ℕ} (r : Refutation F d) :

A refutation of degree at most d witnesses RefutableInDegree F d.

theorem Cslib.Logic.PL.SOS.RefutableInDegree.mono {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] {F : List (MvPolynomial σ R)} {d d' : ℕ} (h : RefutableInDegree F d) (hd : d ≤ d') :

A refutation of degree at most d has degree at most d' for d ≤ d'.

theorem Cslib.Logic.PL.SOS.RefutableInDegree.of_sum {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] {F : List (MvPolynomial σ R)} {d : ℕ} {ι : Type u_3} [Fintype ι] (g f : ι → MvPolynomial σ R) (hf : ∀ (i : ι), f i ∈ F) (hdeg : ∀ (i : ι), (g i * f i).totalDegree ≤ d) (squares : List (R × MvPolynomial σ R)) (hw : ∀ p ∈ squares, 0 ≤ p.1) (hsq : ∀ p ∈ squares, 2 * p.2.totalDegree ≤ d) (h : ∑ i : ι, g i * f i + (List.map (fun (p : R × MvPolynomial σ R) => MvPolynomial.C p.1 * p.2 ^ 2) squares).sum = -1) :

Building a refutation from a combination of members of F, indexed by any finite type: members may repeat and appear in any order.

theorem Cslib.Logic.PL.SOS.RefutableInDegree.of_list {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] {F : List (MvPolynomial σ R)} {d : ℕ} (L : List (MvPolynomial σ R × MvPolynomial σ R)) (hL : ∀ p ∈ L, p.2 ∈ F ∧ (p.1 * p.2).totalDegree ≤ d) (squares : List (R × MvPolynomial σ R)) (hw : ∀ p ∈ squares, 0 ≤ p.1) (hsq : ∀ p ∈ squares, 2 * p.2.totalDegree ≤ d) (h : (List.map (fun (p : MvPolynomial σ R × MvPolynomial σ R) => p.1 * p.2) L).sum + (List.map (fun (p : R × MvPolynomial σ R) => MvPolynomial.C p.1 * p.2 ^ 2) squares).sum = -1) :

Building a refutation from a list of pairs (g, f) with f ∈ F and deg (g f) ≤ d.

structure Cslib.Logic.PL.SOS.PseudoExpectation {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] (F : List (MvPolynomial σ R)) (d : ℕ) :
Type (max u_1 u_2)

A pseudo-expectation of degree d for the polynomial equations f = 0, f ∈ F: a linear map Ẽ from polynomials to R with Ẽ 1 = 1, Ẽ (s ^ 2) ≥ 0 whenever 2 deg s ≤ d, and Ẽ (q f) = 0 for f ∈ F whenever deg (q f) ≤ d.

noncomputable def Cslib.Logic.PL.SOS.PseudoExpectation.ofEval {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] {F : List (MvPolynomial σ R)} {d : ℕ} [IsOrderedRing R] (x : σ → R) (hx : ∀ f ∈ F, (MvPolynomial.eval x) f = 0) :

Evaluation at a common zero of F is a pseudo-expectation of every degree, over a linearly ordered ring.

@[simp]
theorem Cslib.Logic.PL.SOS.PseudoExpectation.ofEval_apply {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] {F : List (MvPolynomial σ R)} {d : ℕ} [IsOrderedRing R] (x : σ → R) (hx : ∀ f ∈ F, (MvPolynomial.eval x) f = 0) (p : MvPolynomial σ R) :

The pseudo-expectation ofEval x hx is evaluation at x.

Pseudo-expectations rule out refutations: over a strictly ordered ring, if a pseudo-expectation of degree d exists, there is no sum-of-squares refutation of degree at most d.

theorem Cslib.Logic.PL.SOS.RefutableInDegree.not_exists_eval_eq_zero {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] [IsStrictOrderedRing R] {F : List (MvPolynomial σ R)} {d : ℕ} (h : RefutableInDegree F d) :
¬∃ (x : σ → R), ∀ f ∈ F, (MvPolynomial.eval x) f = 0

Soundness of sum-of-squares refutations: over a strictly ordered ring, a system with a refutation of some degree has no common zero.