Documentation

CslibFrontier.Logics.Propositional.Algebraic.SumOfSquares.Positivstellensatz

Positivstellensatz refutations with inequalities #

A Positivstellensatz refutation of the inequality constraints f ≥ 0, f ∈ I, and the equations g = 0, g ∈ E, over an ordered commutative ring R is an identity

∑ⱼ hⱼ gⱼ + ∑ₖ cₖ sₖ ² ∏_{f ∈ Sₖ} f = -1

with gⱼ ∈ E, finite sets Sₖ ⊆ I and weights cₖ ≥ 0. No common solution of the constraints can exist, since the left-hand side is nonnegative there (Psatz.RefutableInDegree.not_exists_eval). Degree is counted per summand: a refutation has degree at most d (Psatz.Refutation I E d) when every hⱼ gⱼ has total degree at most d and every summand has formal degree 2 deg sₖ + ∑_{f ∈ Sₖ} deg f at most d (Psatz.Summand.degree). The formal degree bounds the total degree (Psatz.Summand.totalDegree_toPoly_le), and over a domain it is the total degree of every nonzero summand (Psatz.Summand.totalDegree_toPoly).

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, with each sum of squares p_S written as a sum of weighted squares, and with equations added. That definition has inequalities only. Writing g = 0 there as the pair g ≥ 0, -g ≥ 0, every summand that contains one of the two is a multiple h g of degree at most d, an equation term here. Equation terms allow a multiplier h of any sign, as in SOS.Refutation, and a sum-of-squares refutation of equations is the case without inequality factors (SOS.RefutableInDegree.psatz, Psatz.refutableInDegree_empty_iff). The degree bound of Barak and Steurer is on the total degree of p_S ∏_{f ∈ S} f. The formal degree here is at least that, and the two agree on nonzero summands over a domain.

The dual objects are pseudo-expectations (Psatz.PseudoExpectation I E d): linear maps Ẽ with Ẽ 1 = 1, Ẽ (s ^ 2 ∏_{f ∈ S} f) ≥ 0 for finite S ⊆ I of formal degree at most d, and Ẽ (q g) = 0 for g ∈ E whenever deg (q g) ≤ d. This is the formal expectation of a degree-d pseudo-distribution that satisfies the constraints Barak and Steurer, lecture "The sos algorithm over general domains", Definitions 5 and 7 with ℓ = 0, given directly as a linear functional. Applying Ẽ to a refutation gives 0 + (nonnegative) = -1, so a degree-d pseudo-expectation rules out degree-d refutations (Psatz.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. Evaluation at a point that satisfies the inequalities and makes the equations vanish is a pseudo-expectation (Psatz.PseudoExpectation.ofEval). The converse of the duality is not formalized.

Main definitions #

Main results #

References #

structure Cslib.Logic.PL.SOS.Psatz.Summand (σ : Type u_3) (R : Type u_4) [CommRing R] :
Type (max u_3 u_4)

One summand c · s ^ 2 · ∏_{f ∈ S} f of a Positivstellensatz refutation: a finite set S of inequality constraints, a weight c and a polynomial s.

  • factors : Finset (MvPolynomial σ R)

    The set S of inequality constraints multiplied together.

  • weight : R

    The weight c, nonnegative in a refutation.

  • base : MvPolynomial σ R

    The polynomial s that is squared.

noncomputable def Cslib.Logic.PL.SOS.Psatz.Summand.toPoly {σ : Type u_1} {R : Type u_2} [CommRing R] (t : Summand σ R) :

The polynomial c · s ^ 2 · ∏_{f ∈ S} f of a summand.

theorem Cslib.Logic.PL.SOS.Psatz.Summand.toPoly_def {σ : Type u_1} {R : Type u_2} [CommRing R] (t : Summand σ R) :
t.toPoly = MvPolynomial.C t.weight * t.base ^ 2 * ∏ f ∈ t.factors, f
def Cslib.Logic.PL.SOS.Psatz.Summand.degree {σ : Type u_1} {R : Type u_2} [CommRing R] (t : Summand σ R) :

The formal degree 2 deg s + ∑_{f ∈ S} deg f of a summand.

theorem Cslib.Logic.PL.SOS.Psatz.Summand.degree_def {σ : Type u_1} {R : Type u_2} [CommRing R] (t : Summand σ R) :
t.degree = 2 * t.base.totalDegree + ∑ f ∈ t.factors, f.totalDegree

The formal degree of a summand bounds the total degree of its polynomial.

theorem Cslib.Logic.PL.SOS.Psatz.Summand.totalDegree_toPoly {σ : Type u_1} {R : Type u_2} [CommRing R] [IsDomain R] (t : Summand σ R) (hc : t.weight ≠ 0) (hs : t.base ≠ 0) (hS : 0 ∉ t.factors) :

Over a domain, the formal degree of a summand with nonzero weight, base and factors is the total degree of its polynomial.

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

A Positivstellensatz refutation of degree at most d of the constraints f ≥ 0, f ∈ I, and g = 0, g ∈ E: equation terms, pairs (h, g) with g ∈ E standing for h * g, and summands c · s ^ 2 · ∏_{f ∈ S} f with S ⊆ I and c ≥ 0, such that ∑ h * g + ∑ c · s ^ 2 · ∏_{f ∈ S} f = -1, with every h * g of total degree at most d and every summand of formal degree 2 deg s + ∑_{f ∈ S} deg f at most d.

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

The constraints have a Positivstellensatz refutation of degree at most d.

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

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

A refutation of degree at most d witnesses RefutableInDegree I E d.

theorem Cslib.Logic.PL.SOS.Psatz.RefutableInDegree.mono {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] {I I' E E' : Set (MvPolynomial σ R)} {d d' : ℕ} (h : RefutableInDegree I E d) (hI : I ⊆ I') (hE : E ⊆ E') (hd : d ≤ d') :

Refutability is monotone in the constraints and in the degree.

theorem Cslib.Logic.PL.SOS.Psatz.RefutableInDegree.of_sum {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] {I E : Set (MvPolynomial σ R)} {d : ℕ} {ι : Type u_3} {κ : Type u_4} [Fintype ι] [Fintype κ] (h g : ι → MvPolynomial σ R) (t : κ → Summand σ R) (hg : ∀ (i : ι), g i ∈ E) (hgd : ∀ (i : ι), (h i * g i).totalDegree ≤ d) (ht : ∀ (k : κ), ↑(t k).factors ⊆ I) (hw : ∀ (k : κ), 0 ≤ (t k).weight) (hd : ∀ (k : κ), (t k).degree ≤ d) (heq : ∑ i : ι, h i * g i + ∑ k : κ, (t k).toPoly = -1) :

Building a refutation from finite families: equation terms h i * g i and summands t k.

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

A pseudo-expectation of degree d for the constraints f ≥ 0, f ∈ I, and g = 0, g ∈ E: a linear map Ẽ from polynomials to R with Ẽ 1 = 1, Ẽ (s ^ 2 ∏_{f ∈ S} f) ≥ 0 for finite S ⊆ I with 2 deg s + ∑_{f ∈ S} deg f ≤ d, and Ẽ (q g) = 0 for g ∈ E whenever deg (q g) ≤ d.

noncomputable def Cslib.Logic.PL.SOS.Psatz.PseudoExpectation.ofEval {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] {I E : Set (MvPolynomial σ R)} {d : ℕ} [IsOrderedRing R] (x : σ → R) (hI : ∀ f ∈ I, 0 ≤ (MvPolynomial.eval x) f) (hE : ∀ g ∈ E, ∀ (q : MvPolynomial σ R), (q * g).totalDegree ≤ d → (MvPolynomial.eval x) (q * g) = 0) :

Evaluation at a point that satisfies the inequalities, and at which the multiples of the equations of total degree at most d vanish, is a pseudo-expectation of degree d.

@[simp]
theorem Cslib.Logic.PL.SOS.Psatz.PseudoExpectation.ofEval_apply {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] {I E : Set (MvPolynomial σ R)} {d : ℕ} [IsOrderedRing R] (x : σ → R) (hI : ∀ f ∈ I, 0 ≤ (MvPolynomial.eval x) f) (hE : ∀ g ∈ E, ∀ (q : MvPolynomial σ R), (q * g).totalDegree ≤ d → (MvPolynomial.eval x) (q * g) = 0) (p : MvPolynomial σ R) :

The pseudo-expectation ofEval x hI hE 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 Positivstellensatz refutation of degree at most d.

theorem Cslib.Logic.PL.SOS.Psatz.RefutableInDegree.not_exists_eval {σ : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] [IsStrictOrderedRing R] {I E : Set (MvPolynomial σ R)} {d : ℕ} (h : RefutableInDegree I E d) :
¬∃ (x : σ → R), (∀ f ∈ I, 0 ≤ (MvPolynomial.eval x) f) ∧ ∀ g ∈ E, (MvPolynomial.eval x) g = 0

Soundness of Positivstellensatz refutations: over a strictly ordered ring, refutable constraints have no common solution.

Equations only #

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

A sum-of-squares refutation of equations is a Positivstellensatz refutation without inequality factors, for any set I of inequality constraints.

Without inequality constraints, Positivstellensatz refutations of the equations F are sum-of-squares refutations.

A pseudo-expectation for the equations F is a pseudo-expectation for the same equations and no inequality constraints.