Skip to main content

On algorithms testing positivity of real symmetric polynomials

Abstract

We show that positivity (≥0) on \(\mathbb{R}_{+}^{n}\) and on \(\mathbb{R}^{n}\) of real symmetric polynomials of degree at most p in \(n\ge 2\) variables is solvable by algorithms running in polynomial time in the number n of variables. For real symmetric quartics, we find discriminants which lead to the efficient algorithms QE4+ and QE4 running in \(O(n)\) time. We describe the Maple implementation of both algorithms, which are then used not only for testing concrete inequalities (with given numerical coefficients and number of variables), but also for proving symbolic inequalities.

Introduction

In this paper we deal with special cases of the quantifier elimination problems

$$\begin{aligned}& f(x)\ge 0\quad \forall x\in \mathbb{R}_{+}^{n}, \\& f(x)\ge 0\quad \forall x\in \mathbb{R}^{n}, \end{aligned}$$

for polynomials \(f\in \mathbb{R}[X_{1},\dots ,X_{n}]\), which will be referred to as \(\mathrm{QE}_{+}(f)\) and \(\mathrm{QE}(f)\), respectively. The latter is related to Hilbert’s 17th problem on the possibility of writing positive semidefinite real polynomials as sums of squares, and to Artin’s solution to it, according to which the polynomials satisfying \(\mathrm{QE}(f)\) are precisely those which are sums of finitely many squares of rational functions. Furthermore, positive semidefinite symmetric fourth order tensors play an important role in continuum mechanics (as elasticity tensors) and in diffusion weighted magnetic resonance image processing (DW-MRI, for investigating the complex microstructure of the cerebral white matter in-vivo and non-invasively); positive semidefiniteness of such tensors is equivalent to the condition \(\mathrm{QE}(f)\) for a homogeneous symmetric quartic f. Therefore, concrete efficient algorithms deciding on \(\mathrm{QE}_{+}(f)\) and \(\mathrm{QE}(f)\) at least for some classes of polynomials are of interest.

Following the notations from [79], let us consider the vector space \(\Sigma _{p}^{[n]}\) of all real symmetric polynomials of degree at most \(p\in \mathbb{N}\) in \(n\in \mathbb{N}^{*}\) indeterminates and the subspace \({\mathcal{H}}_{p}^{[n]}\) of p-homogeneous polynomials (real symmetric n-ary p-forms). For symmetric cubics \(f\in {\mathcal{H}}_{3}^{[n]}\), it is known from [4, Th. 3.7] that \(\mathrm{QE}_{+}(f)\) holds if and only if

$$ f(\mathbf{1}_{k},\mathbf{0}_{n-k})\ge 0\quad \mbox{for every }k\in \overline{1,n},$$
(1)

where \(\overline{1,n}:=\{1,2,\dots ,n\}\) and \(\mathbf{1}_{k}:=(1,\dots ,1)\in \mathbb{R}^{k}\) and \(\mathbf{0}_{k}:=(0,\dots ,0)\in \mathbb{R}^{k}\) for every k. This equivalence is no longer true for higher degree, but still holds for \(f\in {\mathcal{H}}_{4}^{[n]}\) (symmetric quartic) under the additional condition (see [8, Th. 19(2)])

$$ f(1,-1,\mathbf{0}_{n-2})\le 0. $$

For \(\mathrm{QE}_{+}(f)\) and \(\mathrm{QE}(f)\), the mere existence of an equivalent boolean combination of polynomial inequalities in the coefficients of f follows by the Tarski–Seidenberg principle (see [2] for details). For every fixed degree upper bound \(p\in \mathbb{N}^{*}\), the problems \(\mathrm{QE}_{+}(f)\) and \(\mathrm{QE}(f)\) for \(\deg (f)\le p\) are well known to be unsolvable in polynomial time in n (see for instance [1, Ch. 14]). According to [3], quantifier elimination in real algebra is doubly exponential in the number of variables, even when there is only one free variable and all polynomials in the quantified input are linear. Therefore, existing algorithms cannot be efficient for the problems \(\mathrm{QE}_{+}(f)\) and \(\mathrm{QE}(f)\) restricted to symmetric polynomials, since they perform the same operations as in the general case. Nonetheless, we will show that specific efficient algorithms running in polynomial time in n can be designed in the symmetric case.

For every quartic \(f\in {\mathcal{H}}_{4}^{[n]}\), we assume the representation

$$ f=aP_{4}+bP_{3}P_{1}+cP_{2}^{2}+dP_{2}P_{1}^{2}+eP_{1}^{4}\quad (a,b,c,d,e \in \mathbb{R}),$$
(2)

where \(P_{k}\) denotes the kth symmetric power sum \(P_{k}(x_{1},\dots ,x_{n})=\sum_{j=1}^{n}x_{j}^{k}\). For symbolic quartics, by combining and strengthening several results from [7, 8], both problems \(\mathrm{QE}_{+}(f)\) and \(\mathrm{QE}(f)\) are reduced to equivalent finite systems of univariate polynomial inequalities of degree at most 4, for which we find explicit discriminants (polynomial expressions in the five coefficients). Since the resulting algorithms QE4+ and QE4 test the signs of finitely many discriminants (Theorems 4 and 8), the usual requirements (finiteness, definiteness, effectiveness) are fulfilled. Both algorithms are deterministic, have an input consisting of the number \(n\ge 2\) of variables and the coefficients \(a,b,c,d,e\in \mathbb{R}\), always terminate with one of the possible outputs “\(0\le f\), true” and “\(0\le f\), false”, and run in \(O(n)\) time. Since testing concrete/numerical inequalities becomes trivial, in Sects. 3.3 and 4.2 we mainly give examples of algorithm-assisted proofs for 21 symbolic inequalities,Footnote 1 with coefficients depending on the arbitrary dimension n.

Let us note that many numerical testsFootnote 2 on various valid inequalities (to avoid a quick negative output) confirmed that the running time is linear in n. For the Maple implementation of the algorithms outlined in Figs. 1, 2, the running time is around 60–110 seconds (depending on f) for \(n=10^{6}\) and the amount of memory required for their execution does not depend on n and is about 60–100 MB.

Existence of efficient algorithms in the symmetric case

The following existence result is based on the Tarski–Seidenberg principle and on the half-degree principle from [7, Cor. 2.1].

Theorem 1

(Efficient algorithms)

There exists an algorithm solving for every fixed degree upper bound \(p\in \mathbb{N}^{*}\) the problem \(\mathrm{QE}_{+}(f)/\mathrm{QE}(f)\) for arbitrary \(f\in \Sigma _{p}^{[n]}\) in polynomial time in the number n of variables. The statement also holds for the corresponding problems defined with strict inequalities.

Proof

For all \(p,q\in \mathbb{N}^{*}\), set \({\mathcal{P}}_{p}^{[q]}:=\{g\in \mathbb{R}[X_{1},\dots ,X_{q}]\mid \deg (g)\le p\}\) and

$$ R_{p,q}:= \Biggl\{ r=(r_{1},\dots ,r_{p})\in \bigl(\mathbb{N}^{*}\bigr)^{p} \biggm| \sum _{i=1}^{p}r_{i}=q \Biggr\} ,\qquad R_{p,q}^{+}:=\bigcup_{k=1}^{q}R_{p,k}. $$

The case of \(\mathrm{QE}_{+}(f)\). There is an algorithmFootnote 3\({\mathcal{A}}_{+}\) which solves the problem \(\mathrm{QE}_{+}(g)\) for arbitrary \(g\in {\mathcal{P}}_{p}^{[q]}\) by performing a maximum number of operations denoted by \(N_{+}(p,q)\) (depending on the degree upper bound p and on the number q of variables). Let us fix \(p\in \mathbb{N}^{*}\) and set \(\bar{p}:=\max \{\lfloor \frac{p}{2}\rfloor ,1\}\). For all \(f\in \Sigma _{p}^{[n]}\) and \(r\in R_{\bar{p},n}^{+}\), let us define \(f_{r}\in {\mathcal{P}}_{p}^{[\bar{p}]}\) by

$$ f_{r}(u_{1},\dots ,u_{\bar{p}}):=f(u_{1} \cdot \mathbf{1}_{r_{1}}, \dots ,u_{\bar{p}}\cdot \mathbf{1}_{r_{\bar{p}}},\mathbf{0}_{r'}), $$

where \(r'=n-\sum_{i=1}^{p}r_{i}\). According to [7, Cor. 2.1(1)], for every \(f\in \Sigma _{p}^{[n]}\),

$$ \mathrm{QE}_{+}(f)\mbox{ holds}\quad \iff\quad \mathrm{QE}_{+}(f_{r}) \mbox{ holds}\quad \mbox{for every }r\in R_{\bar{p},n}^{+}.$$
(3)

Let us consider the algorithm \(\tilde{\mathcal{A}}_{+}\) which solves the problem \(\mathrm{QE}_{+}(f)\) by running \({\mathcal{A}}_{+}\) for all \(\mathrm{QE}_{+}(f_{r})\) (\(r\in R_{\bar{p},n}^{+}\)). The number of operations performed by \(\tilde{\mathcal{A}}_{+}\) on f is

$$ N(\tilde{\mathcal{A}}_{+},f)=N_{+}(p,\bar{p})\cdot \operatorname{card}\bigl(R_{ \bar{p},n}^{+}\bigr)=N_{+}(p, \bar{p})\binom{n}{\bar{p}}. $$

Hence, for fixed p, the problem \(\mathrm{QE}_{+}(f)\) for \(f\in \Sigma _{p}^{[n]}\) is solvable in \(O(n^{\bar{p}})\) time.

The case of \(\mathrm{QE}(f)\). Let us note that \(\mathrm{QE}(f)\) cannot hold if \(\deg (f)\) is odd. There is an algorithm \({\mathcal{A}}\) which solves the problem \(\mathrm{QE}(g)\) for arbitrary \(g\in {\mathcal{P}}_{p}^{[q]}\) by performing a maximum number of operations denoted by \(N(p,q)\). Let us fix an even integer \(p\ge 2\) and set \(\bar{p}:=\max \{\frac{p}{2},2\}\). For all \(f\in \Sigma _{p}^{[n]}\) and \(r\in R_{\bar{p},n}\), let us define \(f_{r}\in {\mathcal{P}}_{p}^{[\bar{p}]}\) by

$$ f_{r}(u_{1},\dots ,u_{\bar{p}}):=f(u_{1} \cdot \mathbf{1}_{r_{1}}, \dots ,u_{\bar{p}}\cdot \mathbf{1}_{r_{\bar{p}}}). $$

According to [7, Cor. 2.1(2)], for every \(f\in \Sigma _{p}^{[n]}\), we have the equivalence

$$ \mathrm{QE}(f)\mbox{ holds}\quad \iff\quad \mathrm{QE}(f_{r}) \mbox{ holds}\quad \mbox{for every }r\in R_{\bar{p},n}.$$
(4)

Let us consider the algorithm \(\tilde{\mathcal{A}}\) which solves the problem \(\mathrm{QE}(f)\) by running \(\mathcal{A}\) for all \(\mathrm{QE}(f_{r})\) (\(r\in R_{\bar{p},n}\)). The number of operations performed by \(\tilde{\mathcal{A}}\) on f is

$$ N(\tilde{\mathcal{A}},f)=N(p,\bar{p})\cdot \operatorname{card}(R_{\bar{p},n})=N(p, \bar{p})\binom{n-1}{\bar{p}-1}. $$

Hence, for fixed p, the problem \(\mathrm{QE}(f)\) for \(f\in \Sigma _{p}^{[n]}\) is solvable in \(O(n^{\bar{p}-1})\) time.

The case of strict inequalities. For both problems, the proof using Corollary 2.1 from [7] is similar to the above. □

The problem \(\mbox{QE}_{+}(f)\) in \({\mathcal{H}}_{4}^{[n]}\)

Finite test-sets for \(\mbox{QE}_{+}(f)\)

For every \(f\in {\mathcal{H}}_{4}^{[n]}\) (\(n\ge 2\)) as in (2), we have \(f(1,-1,\mathbf{0}_{n-2})=2(a+2c)\). As pointed out in the introduction, if \(a+2c\le 0\), then

$$ \mathrm{QE}_{+}(f)\quad \iff \quad \text{(1)}.$$
(5)

In the general case, according to (3) the problem \(\mathrm{QE}_{+}(f)\) reduces to the quantifier elimination problems

$$ f(u\cdot \mathbf{1}_{r},v\cdot \mathbf{1}_{s}, \mathbf{0}_{n-r-s}) \ge 0\quad \forall u,v\ge 0, $$

considered for all \(r,s\in \mathbb{N}^{*}\), with \(r+s\le n\). Since \(p=4\) and \(\bar{p}=2\), the algorithm \(\tilde{\mathcal{A}}_{+}\) described in the proof of Theorem 1 solves \(\mathrm{QE}_{+}(f)\) in \(O(n^{2})\) time. Theorem 2 will provide further reductions, leading to the algorithm QE4+, which solves \(\mathrm{QE}_{+}(f)\) in \(O(n)\) time.

For all \(f\in {\mathcal{H}}_{4}^{[n]}\) and \((r,s)\in \mathbb{N}^{*}\times \mathbb{N}^{*}\) with \(r+s\le n\), let us define

$$\begin{aligned}& f_{r,s}:\mathbb{R}\rightarrow \mathbb{R}, \qquad f_{r,s}(t)=f(t \cdot \mathbf{1}_{r},\mathbf{1}_{s}, \mathbf{0}_{n-r-s}), \\& f_{r,s}^{\partial }:\mathbb{R}\setminus \{1\}\rightarrow \mathbb{R}, \qquad f_{r,s}^{\partial }(t)= \frac{ (\frac{\partial f}{\partial x_{1}}-\frac{\partial f}{\partial x_{r+1}} )(t\cdot \mathbf{1}_{r},\mathbf{1}_{s},\mathbf{0}_{n-r-s})}{t-1}. \end{aligned}$$

For every f as in (2), an easy computation shows that

$$ f_{r,s}^{\partial }(t)=4a\bigl(t^{2}+t+1 \bigr)+3b(t+1) (rt+s)+4c\bigl(rt^{2}+s\bigr)+2d(rt+s)^{2}. $$

Hence \(f_{r,s}^{\partial }\) is the restriction of a polynomial function (for which we use the same notation) with \(\deg (f_{r,s}^{\partial })\le 2\). We have the obvious identities

$$ f_{s,r}(t)=t^{4}f_{r,s} \bigl(t^{-1}\bigr)\quad \mbox{and}\quad f_{s,r}^{\partial }(t)=t^{2}f_{r,s}^{\partial } \bigl(t^{-1}\bigr)\quad \mbox{for every }t\in \mathbb{R}^{*}.$$
(6)

Let \(Z^{f}\subset \mathbb{N}^{*}\times \mathbb{N}^{*}\) denote the finite set consisting of all points \((r,s)\) of the form

$$ \textstyle\begin{cases} \mbox{none } (Z^{f}=\emptyset ),& \mbox{if } a+2c\le 0, \\ (k,1),(1,k),\quad \mbox{for }k\in \overline{1,n-1},& \mbox{if } \textstyle\begin{cases} a+2c>0, \\ a\le 0\quad \mbox{or}\quad b\ge 0,\end{cases}\displaystyle \\ (k,1),(1,k),(k,n-k),\quad \mbox{for }k\in \overline{1,n-1},& \mbox{if } \textstyle\begin{cases} a+2c>0, \\ a>0>b.\end{cases}\displaystyle \end{cases} $$

Thus for every \((r,s)\in Z^{f}\) we have \(r+s=n\) or \(r=1\) or \(s=1\). Let the finite sets

$$\begin{aligned}& M^{f} :=\bigl\{ (r,s)\in Z^{f}\mid f_{r,s}^{\partial } \mbox{ is non-constant}\bigr\} , \\& T_{r,s}^{f} :=\bigl\{ (t\cdot \mathbf{1}_{r}, \mathbf{1}_{s},\mathbf{0}_{n-r-s}) \in \mathbb{R}^{n} \mid t>0, \ \ f_{r,s}^{\partial }(t)=0\bigr\} \quad \mbox{for every }(r,s) \in M^{f}, \\& T^{f} :=\bigl\{ (\mathbf{1}_{k},\mathbf{0}_{n-k}) \mid k\in \overline{1,n}\bigr\} \cup \bigcup_{(r,s)\in M^{f}}T_{r,s}^{f}. \end{aligned}$$

The following theorem is a combination of two results from [8, Ths. 13, 14].

Theorem 2

(Finite test sets)

For every \(f\in {\mathcal{H}}_{4}^{[n]}\), we have the equivalence

$$ \mathrm{QE}_{+}(f)\textit{ holds}\quad \iff\quad f(\xi )\ge 0\quad \textit{for every } \xi \in T^{f}. $$

Proof

We only need to prove the implication “”. Suppose \(f|_{T^{f}}\ge 0\), but \(\mathrm{QE}_{+}(f)\) is false. As \(T^{f}\supset \{(\mathbf{1}_{k},\mathbf{0}_{n-k})\mid k\in \overline{1,n}\}\), we see that (1) holds. Therefore, \(a+2c>0\) (otherwise, (5) leads to a contradiction). For every \((r,s)\in \mathbb{N}^{*}\times \mathbb{N}^{*}\) with \(r+s\le n\), by (6) we deduce that

$$ \mathrm{QE}_{+}(f_{r,s})\quad \iff\quad \mathrm{QE}_{+}(f_{s,r}). $$

As \(a+2c>0\), the above equivalence and the definition of \(Z^{f}\) lead by [8, Th. 14] to

$$ \mathrm{QE}_{+}(f)\mbox{ holds}\quad \iff\quad \mathrm{QE}_{+}(f_{r,s}) \mbox{ holds}\quad \mbox{for every }(r,s)\in Z^{f}. $$

Since \(\mathrm{QE}_{+}(f)\) is false, so is \(\mathrm{QE}_{+}(f_{r,s})\) for some \((r,s)\in Z^{f}\). Let us define

$$ g:[0,\infty [\, \rightarrow \mathbb{R},\qquad g(t)= \frac{f_{r,s}(t)}{(rt+s)^{4}}=f \biggl( \frac{t}{rt+s}\cdot \mathbf{1}_{r}, \frac{1}{rt+s}\cdot \mathbf{1}_{s}, \mathbf{0}_{n-r-s} \biggr). $$

Some trivial computations show that

$$\begin{aligned}& g(0)=\frac{f(\mathbf{1}_{s},\mathbf{0}_{n-s})}{s^{4}}\ge 0,\qquad \lim _{t\to \infty }g(t)= \frac{f(\mathbf{1}_{r},\mathbf{0}_{n-r})}{r^{4}}\ge 0, \end{aligned}$$
(7)
$$\begin{aligned}& g'(t)=\frac{rs(t-1)}{(rt+s)^{5}}f_{r,s}^{\partial }(t)\quad \mbox{for every }t\ge 0. \end{aligned}$$
(8)

As \(\mathrm{QE}_{+}(f_{r,s})\) is false, by (7) we see that g has a global minimum \(g(\theta )<0\) at some \(\theta >0\), and so \(g'(\theta )=0\). As \(g(1)=\frac{f(\mathbf{1}_{r+s},\mathbf{0}_{n-r-s})}{(r+s)^{4}}\ge 0>g( \theta )\), we have \(\theta \ne 1\), and so \(f_{r,s}^{\partial }(\theta )=0\), by (8). It follows that \(f_{r,s}^{\partial }\) is non-constant (otherwise, \(f_{r,s}^{\partial }\equiv f_{r,s}^{\partial }(\theta )=0\) yields \(g'\equiv 0\) and \(g\equiv g(0)\ge 0\), which contradicts \(g(\theta )<0\)). Hence \((r,s)\in M^{f}\), and so \(\xi :=(\theta \cdot \mathbf{1}_{r},\mathbf{1}_{s},\mathbf{0}_{n-r-s}) \in T_{r,s}^{f}\subset T^{f}\). We thus get

$$ (r\theta +s)^{4}g(\theta )=f_{r,s}(\theta )=f(\xi )\ge 0, $$

a contradiction. We thus conclude that \(\mathrm{QE}_{+}(f)\) holds. □

Discriminants for \(\mbox{QE}_{+}(f)\)

Our approach to \(\mathrm{QE}_{+}(f)\) is based on Theorem 2. Therefore, we next characterize the inequalities \(f|_{T_{r,s}^{f}}\ge 0\) for \((r,s)\in M^{f}\).

Some easy computations show that

$$ \textstyle\begin{cases} f_{r,s}(t)=A_{r,s}t^{4}+B_{r,s}t^{3}+C_{r,s}t^{2}+D_{r,s}t+E_{r,s}, \\ f_{r,s}^{\partial }(t)=\alpha _{r,s}t^{2}+\beta _{r,s}t+\gamma _{r,s},\end{cases} $$

where

$$\begin{aligned}& \textstyle\begin{cases} A_{r,s}:=r[a+(b+c)r+dr^{2}+er^{3}]=f(\mathbf{1}_{r},\mathbf{0}_{n-r}), \\ B_{r,s}:=rs(b+2dr+4er^{2}), \\ C_{r,s}:=rs[2c+d(r+s)+6ers]=C_{s,r}, \\ D_{r,s}:=rs(b+2ds+4es^{2})=B_{s,r}, \\ E_{r,s}:=s[a+(b+c)s+ds^{2}+es^{3}]=f(\mathbf{1}_{s},\mathbf{0}_{n-s}),\end{cases}\displaystyle \\& \textstyle\begin{cases} \alpha _{r,s}:=4a+(3b+4c)r+2dr^{2}, \\ \beta _{r,s}:=4a+3b(r+s)+4drs=\beta _{s,r}, \\ \gamma _{r,s}:=4a+(3b+4c)s+2ds^{2}=\alpha _{s,r}.\end{cases}\displaystyle \end{aligned}$$

According to Theorem 2 and the definition of \(T^{f}\), for real symbolic polynomials

$$ \textstyle\begin{cases} F(t)=At^{4}+Bt^{3}+Ct^{2}+Dt+E, \\ g(t)=\alpha t^{2}+\beta t+\gamma , \quad g\mbox{ is non-constant},\end{cases} $$

it suffices to compute explicit discriminants for the problem

$$ F(\theta )\ge 0\quad \mbox{for every root } \theta >0\mbox{ of }g$$
(9)

(the result will apply to \((F,g)=(f_{r,s},f_{r,s}^{\partial })\) for \((r,s)\in M^{f}\)). As \(\deg (g)\in \{1,2\}\), analyzing the equation \(g(t)=0\) in both possible cases (\(\alpha \ne 0\) or \(\alpha =0\ne \beta \)) shows the equivalence

$$ \text{(9)}\quad \iff \quad \text{(10)}\quad \textbf{or}\quad \text{(11)} \quad \textbf{or}\quad \text{(12)}, $$

where

$$\begin{aligned}& \textstyle\begin{cases} \alpha =0, \qquad \beta \ne 0, \\ -\frac{\gamma }{\beta }\le 0\quad \textbf{or}\quad F (-\frac{\gamma }{\beta } )\ge 0,\end{cases}\displaystyle \end{aligned}$$
(10)
$$\begin{aligned}& \Delta :=\beta ^{2}-4\alpha \gamma < 0, \end{aligned}$$
(11)
$$\begin{aligned}& \textstyle\begin{cases} \alpha \ne 0\le \Delta , \\ \frac{-\beta +\sqrt{\Delta }}{2\alpha }\le 0\quad \textbf{or}\quad F ( \frac{-\beta +\sqrt{\Delta }}{2\alpha } )\ge 0, \\ \frac{-\beta -\sqrt{\Delta }}{2\alpha }\le 0\quad \textbf{or}\quad F ( \frac{-\beta -\sqrt{\Delta }}{2\alpha } )\ge 0.\end{cases}\displaystyle \end{aligned}$$
(12)

Hence, if \(\alpha \ne 0\le \Delta \), conditions (9) and (12) are equivalent. For the elimination of \(\sqrt{\Delta }\) from (12), we need the following lemma.

Lemma 3

Let \(u,v,\delta \in \mathbb{R}\), with \(\delta \ge 0\). Then

$$ u+v\sqrt{\delta }\ge 0\quad \iff\quad u,v\ge 0\quad \mathbf{or}\quad \rho ,u\ge 0 \quad \mathbf{or}\quad \rho \le 0 \le v, $$

where \(\rho :=u^{2}-v^{2}\delta \).

Proof

The proof is routine. □

Now assume \(\alpha \ne 0\) and \(\Delta \ge 0\) as in (12). Clearly, \(F (\frac{-\beta \pm \sqrt{\Delta }}{2\alpha } )= \frac{P\pm Q\sqrt{\Delta }}{2\alpha ^{4}}\) (with corresponding signs) for some polynomial expressions P, Q, in the coefficients of F and g. We next find the expressions P, Q, and \(P^{2}-Q^{2}\Delta \), since by Lemma 3 these characterize the inequalities \(F (\frac{-\beta \pm \sqrt{\Delta }}{2\alpha } )\ge 0\) from (12). By Taylor’s formula, we get \(\frac{P+Q\sqrt{\Delta }}{2\alpha ^{4}}=F (\frac{-\beta +\sqrt{\Delta }}{2\alpha } )=\sum_{k=0}^{4}F^{(k)} (\frac{-\beta }{2\alpha } ) \frac{(\sqrt{\Delta })^{k}}{k!(2\alpha )^{k}}\). An easy computation gives

$$\begin{aligned} &\begin{aligned} P={}&A\bigl(\beta ^{4}-4\beta ^{2}\alpha \gamma +2\alpha ^{2} \gamma ^{2}\bigr)-B\beta \alpha \bigl(\beta ^{2}-3\alpha \gamma \bigr)+C\alpha ^{2}\bigl( \beta ^{2}-2\alpha \gamma \bigr) \\ &{}-D\beta \alpha ^{3}+2E\alpha ^{4}, \end{aligned} \end{aligned}$$
(13)
$$\begin{aligned} &Q=-A\beta \bigl(\beta ^{2}-2\alpha \gamma \bigr)+B \alpha \bigl(\beta ^{2}-\alpha \gamma \bigr)-C\beta \alpha ^{2}+D\alpha ^{3}. \end{aligned}$$
(14)

Let us observe that \(R:=\frac{P^{2}-Q^{2}\Delta }{4\alpha ^{4}}=\alpha ^{4}F ( \frac{-\beta +\sqrt{\Delta }}{2\alpha } )F ( \frac{-\beta -\sqrt{\Delta }}{2\alpha } )\) is the resultant of the polynomials g and F, and so

$$ R= \begin{vmatrix} A&B&C&D&E&0 \\ 0&A&B&C&D&E \\ \alpha &\beta &\gamma &0&0&0 \\ 0&\alpha &\beta &\gamma &0&0 \\ 0&0&\alpha &\beta &\gamma &0 \\ 0&0&0&\alpha &\beta &\gamma \end{vmatrix}.$$
(15)

For \(\varepsilon \in \{-1,1\}\), by Lemma 3 we get the equivalences

$$\begin{aligned} &P+\varepsilon Q\sqrt{\Delta }\ge 0\quad \iff\quad P,\varepsilon Q\ge 0\quad \textbf{or}\quad P,R\ge 0\quad \textbf{or}\quad \varepsilon Q\ge 0\ge R, \end{aligned}$$
(16)
$$\begin{aligned} &\frac{\beta +\varepsilon \sqrt{\Delta }}{\alpha }\ge 0\quad \iff \quad \varepsilon \alpha ,\varepsilon \beta \ge 0\quad \textbf{or}\quad \varepsilon \beta , \varepsilon \gamma \le 0. \end{aligned}$$
(17)

Consequently, whenever \(\alpha \ne 0\le \Delta \), condition (9) is equivalent to

$$ \textstyle\begin{cases} \alpha ,\beta \le 0 \quad\textbf{or}\quad\beta ,\gamma \ge 0 \quad\textbf{or}\quad P,Q \ge 0 \quad\textbf{or}\quad P,R\ge 0 \quad\textbf{or}\quad Q\ge 0\ge R, \\ \alpha ,\beta \ge 0 \quad\textbf{or}\quad\beta ,\gamma \le 0 \quad\textbf{or}\quad P \ge 0\ge Q \quad\textbf{or}\quad P,R\ge 0 \quad\textbf{or}\quad Q,R\le 0.\end{cases} $$
(18)

Notation 1

For \((F,g)=(f_{r,s},f_{r,s}^{\partial })\), we write conditions (9)–(12), (18) and the expressions P, Q, R from (13)–(15), as (9)\(_{r,s}\)–(12)\(_{r,s}\), (18)\(_{r,s}\), and \(P_{r,s}\), \(Q_{r,s}\), \(R_{r,s}\). Set \(\Delta _{r,s}:=\beta _{r,s}^{2}-4\alpha _{r,s}\gamma _{r,s}\). The discriminants of the problem \(\mathrm{QE}_{+}(f)\) are

$$ \alpha _{r,s},\qquad \beta _{r,s},\qquad \gamma _{r,s},\qquad \Delta _{r,s},\qquad P_{r,s},\qquad Q_{r,s},\qquad R_{r,s}. $$

As the expressions of \(P_{r,s}\), \(Q_{r,s}\), \(R_{r,s}\) are exceedingly longFootnote 4 (they may be visualized by running the first part of the algorithm QE4+ from Fig. 1), we will not reproduce them here. Let us just mention that \(a(r^{2}-rs+s^{2})+crs(r+s)\) is a factor of \(R_{r,s}\).

The following result is the theoretical basis of the algorithm QE4+.

Theorem 4

(Algorithm QE4+)

Let \(f\in {\mathcal{H}}_{4}^{[n]}\). Then

$$ \mathrm{QE}_{+}(f)\quad \Longleftrightarrow \quad \textstyle\begin{cases} \textit{(1)}\textit{ holds for }f, \\ \textit{(18)}_{r,s}\textit{ holds for every }(r,s)\in M^{f} \textit{ such that }\alpha _{r,s}\ne 0\le \Delta _{r,s}.\end{cases} $$

Proof

”. Obviously, \(\mathrm{QE}_{+}(f)\) yields (1). Let us fix \((r,s)\in M^{f}\) such that \(\alpha _{r,s}\ne 0\le \Delta _{r,s}\). By \(\mathrm{QE}_{+}(f)\), we deduce that (9)\(_{r,s}\) holds, hence that (18)\(_{r,s}\) holds.

”. Under the hypothesis of the implication, suppose \(\mathrm{QE}_{+}(f)\) is false. According to Theorem 2, we have \(f(\xi )<0\) for some \(\xi \in T^{f}\). Since (1) holds, \(\xi \in T_{r,s}^{f}\) for some \((r,s)\in M^{f}\). Hence \(f_{r,s}^{\partial }\) is non-constant and \(\xi =(\theta \cdot \mathbf{1}_{r},\mathbf{1}_{s},\mathbf{0}_{n-r-s})\) for some \(\theta >0\) such that \(f_{r,s}^{\partial }(\theta )=0\). Thus \(f_{r,s}(\theta )=f(\xi )<0\), and so (9)\(_{r,s}\) is false. We claim that \(\alpha _{r,s}=0\). On the contrary, suppose \(\alpha _{r,s}\ne 0\). As the quadratic equation \(f_{r,s}^{\partial }(t)=0\) has the real root θ, we have \(\Delta _{r,s}\ge 0\). Since \((r,s)\in M^{f}\) and \(\alpha _{r,s}\ne 0\le \Delta _{r,s}\), according to the hypothesis (18)\(_{r,s}\) holds, but is equivalent to (9)\(_{r,s}\), which is false. This contradiction yields \(\alpha _{r,s}=0\). As \(f_{r,s}^{\partial }\) is non-constant, we have \(\beta _{r,s}\ne 0\), and so \(f_{s,r}^{\partial }\) is non-constant. Hence \((s,r)\in M^{f}\). By (6) it follows that \(f_{s,r}^{\partial }(\theta ^{-1})=0\) and \(f_{s,r}(\theta ^{-1})<0\), and hence that (9)\(_{s,r}\) is false. As above we deduce that \(\gamma _{r,s}=\alpha _{s,r}=0\). Consequently, \(\beta _{r,s}\theta =f_{r,s}^{\partial }(\theta )=0\), that is, \(0=\theta >0\). We thus conclude that \(\mathrm{QE}_{+}(f)\) holds. □

Remark 5

In Theorem 4, for \(r+s\le n\), condition (18)\(_{r,s}\) either holds or need not hold whenever

$$\begin{aligned}& \alpha _{r,s}=0\quad \textbf{or}\quad \Delta _{r,s}< 0\quad \textbf{or}\quad \alpha _{r,s}, \beta _{r,s},\gamma _{r,s}\ge 0\quad \textbf{or} \\& \alpha _{r,s},\beta _{r,s}, \gamma _{r,s}\le 0\quad \textbf{or}\quad P_{r,s},R_{r,s}\ge 0. \end{aligned}$$

The algorithm QE4+ and examples

The algorithm QE4+ resulting from Theorem 4 first computes the needed discriminants α, β, γ, Δ, P, Q, R, and then solves the problem \(\mathrm{QE}_{+}(f)\) by performing tests (1) and (18)\(_{r,s}\) (see Fig. 1 for a Maple implementation). For \(n\ge 3\), this algorithm performs n tests for condition (1) and \(\operatorname{card}(M^{f})\le 3n-6\) sets of tests (of the same complexity for all \((r,s)\in M^{f}\)) for conditions (18)\(_{r,s}\). Hence QE4+ solves \(\mathrm{QE}_{+}(f)\) in \(O(n)\) time.

Figure 1
figure1

Maple implementation of QE4+

Example 1

Let \(f_{\text{1}}=24P_{4}-18P_{3}P_{1}-8P_{2}^{2}+9P_{2}P_{1}^{2}-P_{1}^{4} \in {\mathcal{H}}_{4}^{[n]}\). Then \(f\ge 0\) on \(\mathbb{R}_{+}^{n}\) if and only if \(n\le 4\). (f is the extremal quartic \(H_{(n-2,n-1,n)}\) from [9, Th. 16] for \(n=4\).)

Proof

For the input line containing \(n:=4\), the coefficients of f, and \((r,s):=(r,s)\), the algorithm displays the final output “\(0\le f\), true”. For the input change \(n:=5\), QE4+ shows the intermediate outputs

$$ f(\mathit{one}_{5},\mathit{zero}_{0})=-30,\quad \textit{Test 1, false}, $$

and the final output “\(0\le f\), false”. Since for arbitrary integers \(n>m\ge 1\) the first orthant \(\mathbb{R}_{+}^{m}\) may be identified with \(\mathbb{R}_{+}^{m}\times \{\mathbf{0}_{n-m}\}\subset \mathbb{R}_{+}^{n}\), the conclusion follows. □

Example 2

Let \(f=24P_{4}-19P_{3}P_{1}-7P_{2}^{2}+9P_{2}P_{1}^{2}-P_{1}^{4}\in { \mathcal{H}}_{4}^{[n]}\). Then \(f\ge 0\) on \(\mathbb{R}_{+}^{n}\) if and only if \(n\in \{2,3\}\).

Proof

For the input line containing \(n:=3\), the coefficients of f, and \((r,s):=(r,s)\), the algorithm displays the final output “\(0\le f\), true”. For the input change \(n:=4\), QE4+ shows the intermediate outputs

$$ \begin{aligned} &(r,s)=(1,3),\qquad (\alpha ,\beta ,\gamma ,\Delta ,P,Q,R)=(29,-24,3,228,-108\text{,}828,14\text{,}214,-12\text{,}096), \\ &\quad \textit{Test 2, false} \end{aligned} $$

(that is, condition (18)1,3 is not fulfilled) and the final output “\(0\le f\), false”. The conclusion follows as for Example 1. □

For concrete quartics (with numerical coefficients) such as the above, testing positivity with QE4+ poses no problem. On the other hand, for symbolic/literal quartics, it is quite difficult to decide on the sign of the discriminants, which are polynomial expressions in n, r, s (the coefficients of f may depend on n). For every \((a,b)\in Z^{f}\), we have \(n=r+s\) (if \(r,s\ge 2\)) or \(s=1\le r< n\) or \(r=1\le s< n\), and so in each case all discriminants only depend on two positive integers.

The partition method for symbolic inequalities. For symbolic quartics we can still use the first part of QE4+ to compute symbolic expressions of the discriminants. The idea is to find suitable subsets \(Z_{i}\subset Z^{f}\) (\(i\in I\)) depending on the given quartic such that \(Z^{f}=\bigcup_{i\in I}Z_{i}\) and on each \(Z_{i}\) condition (18)\(_{r,s}\) either holds or need not hold because of some specific combination of signs of discriminants (for instance, if \(\alpha _{r,s},\beta _{r,s}\le 0\) and \(P_{r,s}\ge 0\ge Q_{r,s}\) for every \((r,s)\in Z_{i}\)). Such subsets will be defined by inequalities in r, s, n, allowing us to write the input of QE4+ in terms of some new variables \(p,q\ge 0\), which are not necessarily integers. In this way, for \((r,s)\in Z_{i}\), we will be able to decide on signs of those discriminants having a \(\pm \Sigma _{{+}}\) form, where \(\Sigma _{{+}}\) is a sum (no “”) of products of positive numbers and auxiliary variables p, q, or a quotient of such sums. Such an expression \(E(p,q)\) is said to have a \(\Sigma _{{+}}^{*}\) form if \(E(0,0)>0\). Table 1 shows a possible way of coding the input for several kinds of inequalities in r, s (where we may choose the integers \(r_{0},r_{1},s_{0},s_{1}\in \mathbb{N}^{*}\) and the functions \(\varphi ,\psi :\mathbb{N}^{*}\rightarrow [1,\infty [\) such that \(\varphi \le \psi \)).

Table 1 Input coding for inequalities

For instance, for the input from the third line the algorithm computes with \(r=p+1\), \(s=\varphi (p+1)+q\), and \(n=p+1+\varphi (p+1)+q\), and returns expressions in p, q.

For non-strict sign (≥0 or ≤0) of the discriminants, the input from the fourth line also covers the case \(s=\varphi (r)\), even though \(\omega (q):=\frac{q\varphi (r)+\psi (r)}{q+1}>\varphi (r)\) for every \(q\ge 0\). Indeed, if Λ is a bivariate polynomial such that \(\Lambda (r,\omega (q))\) has a \(\Sigma _{{+}}\) form, then for \(s=\varphi (r)\) we have \(\Lambda (r,s)=\lim_{q\to \infty }\Lambda (r,\omega (q))\ge 0\). A similar comment applies to the inputs from the second and fifth lines of Table 1.

The partition sets \(Z_{i}\) depend on the asymptotes to the algebraic curves defined by the zero sets of the discriminants. For instance, assume that for \((r,s)\in Z^{f}\) with \(r,s\ge 2\) we need to establish the sign behavior of the discriminant (taken from Example 5 below) \(Q_{r,s}=16rs(r-2)(r+s-5)^{4}\Lambda (r,s)\), where

$$\begin{aligned} \Lambda (x,y)={}& x^{7}-6x^{5}y^{2}-8x^{4}y^{3}-3x^{3}y^{4}-8x^{6}+14x^{5}y+60x^{4}y^{2}+46x^{3}y^{3}+8x^{2}y^{4} \\ &{}+9x^{5}-66x^{4}y-189x^{3}y^{2}-102x^{2}y^{3}+12xy^{4}+2x^{4}+144x^{3}y+222x^{2}y^{2} \\ &{}+84xy^{3}-36y^{4}-4x^{3}-92x^{2}y-132xy^{2}+36y^{3}. \end{aligned}$$

We have \(\Lambda =\sum_{k=0}^{7}\Lambda _{k}\), where every \(\Lambda _{k}\) is the k-homogeneous part of Λ. Thus

$$\begin{aligned} &\Lambda _{7}(x,y)=x^{7}-6x^{5}y^{2}-8x^{4}y^{3}-3x^{3}y^{4}=x^{3}(x+y)^{3}(x-3y), \\ &\Lambda _{6}(x,y)=-8x^{6}+14x^{5}y+60x^{4}y^{2}+46x^{3}y^{3}+8x^{2}y^{4}. \end{aligned}$$

Hence \(\Lambda _{7}\) has the linear factor \(ux-vy\), where \((u,v)=(1,3)\). Since \(\frac{\partial \Lambda _{7}}{\partial x}(v,u)=1728\) and \(\frac{\partial \Lambda _{7}}{\partial y}(v,u)=-5184\) are not both 0, the algebraic curve defined by \(\Lambda (x,y)=0\) has the asymptote \(\frac{\partial \Lambda _{7}}{\partial x}(v,u)x+ \frac{\partial \Lambda _{7}}{\partial y}(v,u)y+\Lambda _{6}(v,u)=0\), that is, \(x=3y-\frac{13}{6}\). Since this asymptote lies between the lines of equations \(x=3y-2\) and \(x=3y-3\), we next test the sign of \(Q_{r,s}\) on the regions \(r\ge 3s-2\) and \(r\le 3s-3\). For the first region, running the first part of QE4+ (for the coefficients of f from Example 5) with input \(n:=r+s\) and \((r,s):=(3s-2+p,q+2)\) gives for Q a \(\Sigma _{{+}}^{*}\) expression in \(p,q\ge 0\). Hence \(Q_{r,s}>0\) for \(r\ge 3s-2\) and \(s\ge 2\). For the second region (rewritten as \(s\ge \frac{r+3}{3}\)), running again the first part of QE4+ with the input change \((r,s):= (p+3,\frac{r+3+q}{3} )\) gives for Q a \(-\Sigma _{{+}}\) expression which vanishes only for \(p=q=0\). As \(Q_{2,s}\equiv 0\), we have \(Q_{r,s}\le 0\) for \(2\le r\le 3s-3\). We thus have completely determined the “sign regions” (and the zeros) of the discriminant \(Q_{r,s}\).

Discriminants such as \(Q_{r,1}\) also are expressions in two positive integers, namely r and \(s'=n-r\). Therefore, they may be analyzed in the same way. The partition sets \(Z_{i}\) may be intersections of sign regions of several discriminants.

The partition method illustrated by Examples 46 also applies to the algorithm QE4 and to Examples 712 from Sect. 4.2. In each case we will indicate the restrictions defining the partition sets \(Z_{i}\) (without details as above on calculations of asymptotes), the input to be used with the algorithm, and the specific combination of signs of discriminants making condition (18)\(_{r,s}\) hold for every \((r,s)\in Z_{i}\).

Example 3

Let \(f=2nP_{4}-2(n+1)P_{3}P_{1}-nP_{2}^{2}+(n+3)P_{2}P_{1}^{2}-P_{1}^{4} \in {\mathcal{H}}_{4}^{[n]}\). Then \(f\ge 0\) on \(\mathbb{R}_{+}^{n}\) (f is the extremal quartic \(H_{(1,2,n)}\) from [9, Prop. 14]).

Proof

For the input line containing \(n:=n\), the coefficients of f, and \((r,s):=(r,s)\), running the first part of QE4+ gives \(A=r(r-1)(r-2)(n-r)\) (≥0), which yields \(f(\mathbf{1}_{r},\mathbf{0}_{n-r})=A_{r,s}\ge 0\) for every \(r\in \overline{1,n}\). Hence (1) holds for f. Since \(a+2c=0\), by (5) we conclude that \(\mathrm{QE}_{+}(f)\) holds. □

Example 4

LetFootnote 5\(f=-n(n-1)P_{4}+4(n-1)P_{3}P_{1}+(n^{2}-3n+3)P_{2}^{2}-2nP_{2}P_{1}^{2}+P_{1}^{4} \in {\mathcal{H}}_{4}^{[n]}\). Then \(f\ge 0\) on \(\mathbb{R}_{+}^{n}\) (f is the extremal quartic \(H_{(1,n-1,n)}\) from [9, Prop. 17]).

Proof

For the input line containing \(n:=n\), the coefficients of f, and \((r,s):=(r,s)\), running the first part of QE4+ gives \(A=r(r-1)(n-r)(n-r-1)\) (≥0), and so (1) holds for f. As \(a\le 0\), we have \(M^{f}\subset \{(r,1)\mid r\in \overline{1,n-1}\}\cup \{(1,s)\mid s\in \overline{1,n-1}\}\). Table 2 describes a way of checking conditions (18)\(_{r,s}\) by running the first part of QE4+ for \(r=1\) or \(s=1\). For each line of the table, the discriminants indicated in the last column have a \(\pm \Sigma _{{+}}\) form.Footnote 6

Table 2 Checking conditions (18)\(_{r,s}\) for Example 4

For instance, for the input from the second line, QE4+ displays the expressions \(P=256p(p+1)(q+1)^{5}(p+q)^{3}(p+q+2)(2pq+q+2p^{2}+4p)\) and \(R=0\), and so \(P_{r,1},R_{r,1}\ge 0\). By Theorem 4 and Remark 5 we conclude that \(\mathrm{QE}_{+}(f)\) holds. □

Arguments such as the above are true proofs, since only symbolic computations are involved. Human contribution consists of choosing suitable partitions, entering the input, and noticing that some specific discriminants have a \(\pm \Sigma _{{+}}\) form.

For \(n\ge 4\) the quartics f from Examples 3 and 4 are extremal, that is, have the following property:

$$ g\in {\mathcal{H}}_{4}^{[n]},\quad 0\le g\le f\mbox{ on } \mathbb{R}_{+}^{n}\quad \Longrightarrow \quad g\in [0,1]\cdot f. $$

This means that the inequality \(\mathrm{QE}_{+}(f)\) holds, but cannot be strengthened in \({\mathcal{H}}_{4}^{[n]}\). In other words, these are “best quality” inequalities. For instance, for f as in these examples, running QE4+ for the modified quartic \(f-\varepsilon (P_{3}P_{1}-P_{2}^{2})\in {\mathcal{H}}_{4}^{[n]}\) will display the final output “\(0\le f\), false” for every choice of \(n\ge 2\) and \(\varepsilon >0\).

Example 5

Let \(f=6nP_{4}-4(n+1)P_{3}P_{1}-(n+2)P_{2}^{2}+(n+5)P_{2}P_{1}^{2}-P_{1}^{4} \in {\mathcal{H}}_{4}^{[n]}\). Then \(f\ge 0\) on \(\mathbb{R}_{+}^{n}\) if and only if \(n\ne 4\) (f is the extremal quartic \(H_{(2,3,n)}\) from [9, Th. 16] for \(n\ge 5\)).

Proof

For the input line containing \(n:=2\), the coefficients of f, and \((r,s):=(r,s)\), and for the input change \(n:=3\), the algorithm shows the final output “\(0\le f\), true”. For the input change \(n:=4\), the algorithm displays the final output “\(0\le f\), false”. Now assume \(n\ge 5\). For the input change \(n:=n\), running the first part of QE4+ gives \(A=r(r-2)(r-3)(n-r)\) (≥0), and so (1) holds for f. Table 3 describes a way of checking conditions (18)\(_{r,s}\).

Table 3 Checking conditions (18)\(_{r,s}\) for Example 5

By Theorem 4 and Remark 5 we conclude that \(\mathrm{QE}_{+}(f)\) holds. □

Example 6

Let

$$ f=n(n-1) (n-2)P_{4}-2(n-1)^{2}P_{3}P_{1}-n(n-2)P_{2}^{2}+3(n-1)P_{2}P_{1}^{2}-P_{1}^{4} \in {\mathcal{H}}_{4}^{[n]}. $$

Then \(f\ge 0\) on \(\mathbb{R}_{+}^{n}\) (f is the extremal quartic \(H_{(n-2,n-1,n)}\) from [9, Th. 16] for \(n\ge 3\)).

Proof

For the input line containing \(n:=n\), the coefficients of f, and \((r,s):=(r,s)\), running the first part of QE4+ gives \(A=r(n-r)(n-r-1)(n-r-2)\) (≥0), and so (1) holds for f. Table 4 describes a way of checking conditions (18)\(_{r,s}\).

Table 4 Checking conditions (18)\(_{r,s}\) for Example 6

By Theorem 4 and Remark 5 we conclude that \(\mathrm{QE}_{+}(f)\) holds. □

The problem \(\mbox{QE}(f)\) in \({\mathcal{H}}_{4}^{[n]}\)

Discriminants for \(\mbox{QE}(f)\)

According to (4), for every symmetric quartic \(f\in {\mathcal{H}}_{4}^{[n]}\), the problem \(\mathrm{QE}(f)\) reduces to the quantifier elimination problems

$$ f(u\cdot \mathbf{1}_{r},v\cdot \mathbf{1}_{s})\ge 0 \quad \forall u,v\in \mathbb{R}, $$

considered for all \(r,s\in \mathbb{N}^{*}\), with \(r+s=n\). Since f is symmetric, we may restrict the algorithm \(\tilde{\mathcal{A}}\) described in the proof of Theorem 1 to run only for \(s\ge r\ge 1\). For the restricted algorithm \({\mathcal{Q}}{\mathcal{E}}4\) obtained in this way, the running time is reduced to the half, while the complexity is the same as that of \(\tilde{\mathcal{A}}\). The number of operations performed by \({\mathcal{Q}}{\mathcal{E}}4\) on f is

$$ N({\mathcal{Q}} {\mathcal{E}}4,f)=N(4,2) \biggl\lfloor \frac{n}{2} \biggr\rfloor . $$

Hence \({\mathcal{Q}}{\mathcal{E}}4\) solves \(\mathrm{QE}(f)\) in \(O(n)\) time. By the first equivalence from [7, Cor. 5.6], we see that

$$ \mathrm{QE}(f)\mbox{ holds}\quad \iff \quad \mathrm{QE}(f_{r}) \mbox{ holds}\quad \mbox{for every }r\in \overline{1,n-1}, $$

where \(f_{r}(t):=f_{r,n-r}(t)=f(t\cdot \mathbf{1}_{r},\mathbf{1}_{n-r})\) for every \(t\in \mathbb{R}\). To simplify notation, we will write the coefficients \(A_{r,n-r},\dots ,E_{r,n-r}\) of \(f_{r}\) as \(A_{r},\dots ,E_{r}\). For arbitrary real symbolic polynomial

$$ F(t)=At^{4}+Bt^{3}+Ct^{2}+Dt+E\quad (A>0),$$
(19)

we need to compute explicit discriminants for the univariate problem \(\mathrm{QE}(F)\), or for its equivalent form

$$ F(t)\ge 0 \quad \mbox{for every real root }t\mbox{ of the derivative }F'.$$
(20)

Solving (20) depends on the nature of the roots \(z_{1},z_{2},z_{3}\in \mathbb{C}\) of the polynomial \(F'\in \mathbb{R}[t]\subset \mathbb{C}[t]\) (and hence on its discriminant), as well as on the expressions

$$ \textstyle\begin{cases} G:=256A^{3}[F(z_{1})+F(z_{2})+F(z_{3})], \\ H:=128A^{3}[F(z_{1})F(z_{2})+F(z_{1})F(z_{3})+F(z_{2})F(z_{3})], \\ K:=256A^{3}F(z_{1})F(z_{2})F(z_{3}).\end{cases} $$
(21)

Up to a positive factor, the discriminant of the cubic \(F'\) is

$$ \Delta :=-108A^{2}D^{2}+4AC \bigl(27BD-8C^{2}\bigr)-9B^{2}\bigl(3BD-C^{2} \bigr).$$
(22)

In order to compute G, H, K, let us observe that, for every \(y\in \mathbb{R}\), the resultant of \(F_{y}:=F+y\) and \(F_{y}'=F'\) is

$$ R\bigl(F_{y},F'\bigr)=(4A)^{4}\prod _{j=1}^{3}F_{y}(z_{j})=256A^{4}y^{3}+A \bigl(Gy^{2}+2Hy+K\bigr). $$

Identifying here the coefficients of the polynomials in y leads to

$$\begin{aligned} &G=768A^{3}E-64A^{2} \bigl(3BD+2C^{2}\bigr)+144AB^{2}C-27B^{4}, \end{aligned}$$
(23)
$$\begin{aligned} & \begin{aligned} H={}&384A^{3}E^{2}-8A^{2} \bigl(24BDE+16C^{2}E-9CD^{2}\bigr) \\ &{}+A\bigl(144B^{2}CE-3B^{2}D^{2}-40BC^{2}D+8C^{4} \bigr) \\ &{}-B^{2}\bigl(27B^{2}E-9BCD+2C^{3}\bigr), \end{aligned} \end{aligned}$$
(24)
$$\begin{aligned} &K=\frac{R(F,F')}{A}= \begin{vmatrix} 1 &B&C&D&E&0&0 \\ 0 &A&B&C&D&E&0 \\ 0 &0&A&B&C&D&E \\ 4 &3B&2C&D&0&0&0 \\ 0 &4A&3B&2C&D&0&0 \\ 0 &0&4A&3B&2C&D&0 \\ 0 &0&0&4A&3B&2C&D \end{vmatrix}. \end{aligned}$$
(25)

Notation 2

  1. (i)

    The polynomial expressions Δ, G, H, K from the right-hand members of (22)–(25) will be considered even if \(A=0\).

  2. (ii)

    For \(F=f_{r}\), we write the above expressions as \(\Delta _{r}\), \(G_{r}\), \(H_{r}\), \(K_{r}\) (which are the discriminants of the problem \(\mathrm{QE}(f)\)) and condition (26) from Theorem 7 will be referred to as (26)r.

Our next lemma may be viewed as a special case of Descartes’ rule of signs.

Lemma 6

Let \(u\in \mathbb{R}^{m}\). Then

$$ u\in \mathbb{R}_{+}^{m}\quad \iff\quad e_{k}(u)\ge 0\quad \textit{for every }k\in \overline{1,m}, $$

where \(e_{1}, e_{2}, \dots , e_{m}\) denote the elementary symmetric functions in m variables.

Proof

We only need to prove “”. Suppose \(t:=\min_{1\le j\le m}u_{j}<0\). Then the hypothesis yields \(0<(-t)^{m}+\sum_{k=1}^{m}e_{k}(u)(-t)^{m-k}=\prod_{k=1}^{m}(u_{k}-t)=0\), which is absurd. Hence \(u\in \mathbb{R}_{+}^{m}\). □

The following needed result is a version of [6, Th. 1]; however, it is much easier to give a direct proof than to derive it from the cited result.

Theorem 7

Let a polynomial F be as in (19). Then \(\mathrm{QE}(F)\) is equivalent to

$$ K\ge 0>\Delta \quad \mathbf{or}\quad G,H,K\ge 0.$$
(26)

Proof

As \(A\ne 0\), we have \(\deg (F)=4\) and \(\deg (F')=3\). Let \(z_{1}\in \mathbb{R}\) and \(z_{2},z_{3}\in \mathbb{C}\) denote the roots of \(F'\).

”. If \(\Delta <0\), then \(z_{3}=\bar{z}_{2}\in \mathbb{C}\setminus \mathbb{R}\), and so \(F(z_{1})\ge 0\), \(F(z_{3})=\overline{F(z_{2})}\). We thus get \(K=256A^{3}F(z_{1})|F(z_{2})|^{2}\ge 0>\Delta \). If \(\Delta \ge 0\), then \(z_{1},z_{2},z_{3}\in \mathbb{R}\), and so \(F(z_{1}),F(z_{2}),F(z_{3})\ge 0\). Since \(A>0\), this leads by (21) to \(G,H,K\ge 0\).

”. Suppose (26) is true, but (20) is false. There is no loss of generality in assuming that \(F(z_{1})<0\). As \(K\ge 0\), we have \(F(z_{2})F(z_{3})\le 0\). We next analyze two cases.

Case 1. If \(\Delta <0\), then \(F(z_{3})=\overline{F(z_{2})}\) leads to \(|F(z_{2})|^{2}=F(z_{2})F(z_{3})\le 0\), which yields \(F(z_{2})=F(z_{3})=0\). Hence both \(z_{2},z_{3}\in \mathbb{C}\setminus \mathbb{R}\) are repeating roots of F, and so F has no real roots. We thus get \(F>0\) on \(\mathbb{R}\), a contradiction.

Case 2. If \(\Delta \ge 0\), then (26) yields \(G,H,K\ge 0\). Since \((F(z_{1}),F(z_{2}),F(z_{3}))\in \mathbb{R}^{3}\), by Lemma 6 it follows that \(F(z_{1})\ge 0\), a contradiction.

By the above cases we conclude that F satisfies (20), that is, \(\mathrm{QE}(F)\) holds. □

The following result is the theoretical basis of the algorithm QE4.

Theorem 8

(Algorithm QE4)

Let \(f\in {\mathcal{H}}_{4}^{[n]}\). Then

$$ \mathrm{QE}(f)\quad \Longleftrightarrow \quad \textstyle\begin{cases} \textit{(1)}\textit{ holds for }f, \\ \textit{(26)}_{r}\textit{ holds for every }r\in \overline{1,n-1}.\end{cases} $$

Proof

”. Clearly, \(\mathrm{QE}(f)\) yields (1). Let us fix \(r\in \overline{1,n-1}\). As \(\mathrm{QE}(f_{r})\) holds, we have \(A_{r}\ge 0\) and \(f_{r}\) has even degree (or \(f_{r}\equiv 0\)). We next analyze two cases.

Case 1. If \(\deg (f_{r})\le 2\), then \(A_{r}=B_{r}=0\) leads by (23)–(25) to \(G_{r}=H_{r}=K_{r}=0\). Hence (26)r holds.

Case 2. If \(\deg (f_{r})=4\), then \(A_{r}>0\). By Theorem 7, \(\mathrm{QE}(f_{r})\) yields (26)r.

From the above cases we conclude that (26)r holds for every \(r\in \overline{1,n-1}\).

”. Fix \(r\in \overline{1,n-1}\). Let us observe that

$$ \textstyle\begin{cases} (A_{n-r},B_{n-r},C_{n-r},D_{n-r},E_{n-r})=(E_{r},D_{r},C_{r},B_{r},A_{r}), \\ f_{n-r}(t)=t^{4}f_{r}(t^{-1} )\quad\mbox{for every }t\in \mathbb{R} \setminus \{0\}.\end{cases} $$
(27)

By (1) we see that \(A_{r}=f(\mathbf{1}_{r},\mathbf{0}_{n-r})\ge 0\) and, similarly, \(A_{n-r}\ge 0\). We need to analyze three cases.

Case 1. If \(A_{r}>0\), then \(\mathrm{QE}(f_{r})\) holds by (26)r and Theorem 7.

Case 2. If \(A_{n-r}=E_{r}>0\), as in the previous case, it follows that \(\mathrm{QE}(f_{n-r})\) holds, and consequently so does \(\mathrm{QE}(f_{r})\) by (27).

Case 3. If \(A_{r}=E_{r}=0\), some easy computations lead by (22), (23), (25) to

$$ \textstyle\begin{cases} \Delta _{r}=9B_{r}^{2}(C_{r}^{2}-3B_{r}D_{r}), \\ G_{r}=-27B_{r}^{4},\qquad K_{r}=B_{r}^{2}D_{r}^{2}(C_{r}^{2}-4B_{r}D_{r}).\end{cases} $$
(28)

We claim that \(B_{r}=0\). On the contrary, suppose that \(B_{r}\ne 0\). As (26)r holds and \(G_{r}<0\), we have \(K_{r}\ge 0>\Delta _{r}\). It follows successively that \(3B_{r}D_{r}>C_{r}^{2}\ge 0\) and \(C_{r}^{2}\ge 4B_{r}D_{r}\), and hence that \(4C_{r}^{2}<12B_{r}D_{r}\le 3C_{r}^{2}\), which is absurd. Our claim is proved. The same argument using (26)\(_{n-r}\) yields \(D_{r}=B_{n-r}=0\). By (1) we get \(C_{r}=f_{r}(1)=f(\mathbf{1}_{r},\mathbf{0}_{n-r})\ge 0\), and so \(f_{r}(t)=C_{r}t^{2}\ge 0\) for every \(t\in \mathbb{R}\).

According to the above three cases, \(\mathrm{QE}(f_{r})\) holds for every \(r\in \overline{1,n-1}\). We thus conclude that \(\mathrm{QE}(f)\) holds. □

The algorithm QE4 and examples

The algorithm QE4 resulting from Theorem 8 first computes the needed discriminants Δ, G, H, K, and then solves the problem \(\mathrm{QE}(f)\) by performing tests (1) and (26)r (see Fig. 2 for a Maple implementation). The algorithm performs n tests for condition (1) and \(n-1\) sets of tests (of the same complexity for all \(r\in \overline{1,n-1}\)) for conditions (26)r. Hence QE4 solves \(\mathrm{QE}(f)\) in \(O(n)\) time.

Figure 2
figure2

Maple implementation of QE4

Example 7

Let \(f=-2(n-1)P_{3}P_{1}+(n-2)P_{2}^{2}+(n+1)P_{2}P_{1}^{2}-P_{1}^{4}\in { \mathcal{H}}_{4}^{[n]}\). Then \(f\ge 0\) on \(\mathbb{R}^{n}\) (equivalent to Newton’s inequality \(S_{2}^{2}\ge S_{1}S_{3}\), where \(S_{k}:=e_{k}/\binom{n}{k}\)).

Proof

For the input line containing \(n:=n\), the coefficients of f, and \((r,s):=(r,s)\), running the first part of QE4 gives \(A=r^{2}(r-1)(n-r)\) (≥0), and so (1) holds for f. Table 5 describes a way of checking conditions (26)r.

Table 5 Checking conditions (26)r for Example 7

For instance, for the input from the first line of the table QE4 displays the expressions \(K=0\) and \(H:=8q(q+1)^{5}(p+1)(p+2)^{5}(p+q+1)^{3}(p+q+2)^{4}\), and so \(H_{r}\ge 0=K_{r}\). The expression of G is longer, but still has a \(\Sigma _{{+}}\) form. By Theorem 8 we conclude that \(\mathrm{QE}(f)\) holds. □

Example 8

Let \(f\in {\mathcal{H}}_{4}^{[n]}\) as in Example 4. Then \(f\ge 0\) on \(\mathbb{R}^{n}\).

Proof

That (1) holds for f was already proved in Example 4. For the input line containing \(n:=n\), the coefficients of f, and \((r,s):=(r,s)\), running the first part QE4 gives \(G=H=K=0\). By Theorem 8 we conclude that \(\mathrm{QE}(f)\) holds. □

In the last four examples we use the notation \(M_{k}:=\frac{P_{k}}{k}\) for every \(k\in \overline{1,4}\). It is well known that \(M_{4}\ge M_{3}M_{1}\) and \(M_{4}\ge M_{2}^{2}\ge M_{2}M_{1}^{2}\ge M_{1}^{4}\) on \(\mathbb{R}^{n}\). The 14 inequalities from the next three examples are probably new; some are known for 3 variables (see for instance [5]), not for arbitrary n. They may also be obtained by the interpolation λ-method (of Mitrinović and Vasić) described in [5, Ch. XXIX].

Example 9

On \(\mathbb{R}^{n}\) we have the inequalities

$$ \begin{aligned} &M_{4}+3M_{2}^{2} \ge 4M_{3}M_{1},\qquad M_{4}+M_{2}M_{1}^{2} \ge 2M_{3}M_{1}, \\ &M_{4}+(2\sqrt{3}-3)M_{1}^{4}\ge (2 \sqrt{3}-2)M_{3}M_{1} ,\qquad M_{4}+M_{1}^{4} \ge 2M_{2}M_{1}^{2}, \\ &M_{4}+8M_{2}M_{1}^{2}\ge 4M_{3}M_{1}+M_{2}^{2}+4M_{1}^{4}, \qquad M_{4}+3M_{2}M_{1}^{2} \ge 2M_{3}M_{1}+M_{2}^{2}+M_{1}^{4}.\end{aligned} $$

Proof

For such inequalities, the discriminants obtained with input \(n:=r+s\) are homogeneous in \((r,s)\). By writing them in the formFootnote 7\(s^{k}Q(\frac{r}{s})\), we may find intervals for \(\frac{r}{s}\) on which condition (26)r holds because of some specific combination of discriminants (which may not be the same for all intervals). This is how we found the suitable restrictions for the proofs of the inequalities from Examples 911.

First inequality (the best of the form \(M_{4}-M_{3}M_{1}\ge \lambda (M_{3}M_{1}-M_{2}^{2})\), with \(\lambda >0\)). Let \(f_{1}=nP_{4}-4P_{3}P_{1}+3P_{2}^{2}\in {\mathcal{H}}_{4}^{[n]}\). For the input line containing \(n:=n\), the coefficients of \(f_{1}\), and \((r,s):=(r,s)\), running the first part of QE4 gives \(A=r(n-r)\) (≥0) and \(\Delta =G=H=K=0\). By Theorem 8 we conclude that \(\mathrm{QE}(f_{1})\) holds.

Second inequality (the best of the form \(M_{4}-M_{3}M_{1}\ge \lambda (M_{3}M_{1}-M_{2}M_{1}^{2})\), with \(\lambda >0\)). Let \(f_{2}=n^{2}P_{4}-2nP_{3}P_{1}+P_{2}P_{1}^{2}\in {\mathcal{H}}_{4}^{[n]}\). For the input line containing \(n:=n\), the coefficients of \(f_{2}\), and \((r,s):=(r,s)\), running the first part of QE4 gives \(A=r(n-r)^{2}\) (≥0), and so (1) holds for \(f_{2}\). Table 6 describes a way of checking conditions (26)r.

Table 6 Checking conditions (26)r for the second inequality from Example 9

By Theorem 8 we conclude that \(\mathrm{QE}(f_{2})\) holds.

Third inequality (the best of the form \(M_{4}-M_{3}M_{1}\ge \lambda (M_{3}M_{1}-M_{1}^{4})\), with \(\lambda >0\)). Let \(f_{3}=n^{3}P_{4}-(2\sqrt{3}-2)n^{2}P_{3}P_{1}+(2\sqrt{3}-3)P_{1}^{4} \in {\mathcal{H}}_{4}^{[n]}\). For the input line containing \(n:=n\), the coefficients of \(f_{3}\), and \((r,s):=(r,s)\), running the first part of QE4 gives \(A,G,H\ge 0=K\) (we get A, G, H as expressions having a \(\Sigma _{{+}}\) form multiplied by the positive constants \(7-4\sqrt{3}\), \(1351-780\sqrt{3}\), and \(97-56\sqrt{3}\), respectively). By Theorem 8 we conclude that \(\mathrm{QE}(f_{3})\) holds.

Fourth inequality (the best of the form \(M_{4}-M_{2}M_{1}^{2}\ge \lambda (M_{2}M_{1}^{2}-M_{1}^{4})\), with \(\lambda >0\)). Let \(f_{4}=n^{3}P_{4}-2nP_{2}P_{1}^{2}+P_{1}^{4}\in {\mathcal{H}}_{4}^{[n]}\). For the input line containing \(n:=n\), the coefficients of \(f_{4}\), and \((r,s):=(r,s)\), running the first part of QE4 gives \(A=r(n-r)(n^{2}+nr-r^{2})\) (≥0), and so (1) holds for \(f_{4}\). For the input change \(n:=r+s\), running again the first part of QE4 gives \(G,H\ge 0=K\). By Theorem 8 we conclude that \(\mathrm{QE}(f_{4})\) holds.

Fifth inequality (the best of the form \(M_{4}-4M_{3}M_{1}+3M_{2}^{2}\ge \lambda (M_{2}-M_{1}^{2})^{2}\), with \(\lambda >0\)). Let \(f_{5}=n^{3}P_{4}-4n^{2}P_{3}P_{1}-n^{2}P_{2}^{2}+8nP_{2}P_{1}^{2}-4P_{1}^{4} \in {\mathcal{H}}_{4}^{[n]}\). For the input line containing \(n:=n\), the coefficients of \(f_{5}\), and \((r,s):=(r,s)\), running the first part of QE4 gives \(A=r(n-r)(n-2r)^{2}\) (≥0) and \(G=H=K=0\). By Theorem 8 we conclude that \(\mathrm{QE}(f_{5})\) holds.

Sixth inequality (the best of the form \(M_{4}-2M_{3}M_{1}+M_{2}M_{1}^{2}\ge \lambda (M_{2}-M_{1}^{2})^{2}\), with \(\lambda >0\)). Let \(f_{6}=n^{3}P_{4}-2n^{2}P_{3}P_{1}-n^{2}P_{2}^{2}+3nP_{2}P_{1}^{2}-P_{1}^{4} \in {\mathcal{H}}_{4}^{[n]}\). For the input line containing \(n:=n\), the coefficients of \(f_{6}\), and \((r,s):=(r,s)\), running the first part of QE4 gives \(A=r(n-r)^{3}\) (≥0) and \(G=16n^{4}r^{4}(n-r)^{8}\), and \(H=K=0\). By Theorem 8 we conclude that \(\mathrm{QE}(f_{6})\) holds. □

Example 10

On \(\mathbb{R}^{n}\) we have the inequalities

$$\begin{aligned} &M_{4}-M_{3}M_{1}\ge \frac{3}{4} \bigl(M_{2}^{2}-M_{2}M_{1}^{2} \bigr),\qquad M_{4}-M_{3}M_{1} \ge \frac{3}{8}\bigl(M_{2}^{2}-M_{1}^{4} \bigr), \\ &M_{4}-M_{3}M_{1}\ge \frac{3}{4} \bigl(M_{2}M_{1}^{2}-M_{1}^{4} \bigr),\qquad M_{4}-M_{2}M_{1}^{2} \ge \frac{1}{2}\bigl(M_{2}^{2}-M_{1}^{4} \bigr). \end{aligned}$$

Proof

All inequalities have the form \(g\ge \lambda h\). In each case we define the quartic \(f=n^{4}(g-\lambda h)\), whose coefficients are entered in the input line of QE4, together with the input change \(n:=r+s\). Running the first part of QE4 gives \(A,G,H\ge 0=K\) (all have a \(\Sigma _{{+}}\) form). By Theorem 8 we conclude that \(\mathrm{QE}(f)\) holds. □

For quartics with irrational coefficients it may not be clear that a discriminant has a \(\pm \Sigma _{{+}}\) form, because its expression contains numbers such as \(99-70\sqrt{2}\approx 0.005\). In such cases we may add at the end of the first part of QE4 the command line

$$ [{>}\quad A:=\mathit{evalf}(A);\ \Delta :=\mathit{evalf}( \Delta );\ K:= \mathit{evalf}(K);\ H:=\mathit{evalf}(H);\ G:=\mathit{evalf}(G). $$

This will result in displaying all numerical coefficients as decimal numbers. The rounding to decimals will not lead to proof errors, since it is only done at the very end in order to establish which discriminants have a \(\pm \Sigma _{{+}}\) form.

Example 11

On \(\mathbb{R}^{n}\) we have the inequalities

$$\begin{aligned} &M_{4}-M_{2}M_{1}^{2}\ge 2( \sqrt{2}+1) \bigl(M_{3}M_{1}-M_{2}^{2} \bigr),\qquad M_{4}-M_{1}^{4} \ge 2(\sqrt{3}+1) \bigl(M_{3}M_{1}-M_{2}^{2} \bigr), \\ &M_{4}-M_{2}M_{1}^{2}\ge 2( \sqrt{2}-1) \bigl(M_{3}M_{1}-M_{1}^{4} \bigr),\qquad M_{4}-M_{1}^{4} \ge 2\sqrt{2} \bigl(M_{3}M_{1}-M_{2}M_{1}^{2} \bigr). \end{aligned}$$

Proof

First inequality (the best of the form \(M_{4}-M_{2}M_{1}^{2}\ge \lambda (M_{3}M_{1}-M_{2}^{2})\), with \(\lambda >0\)). Let \(f_{1}=n^{2}P_{4}-2(\sqrt{2}+1)nP_{3}P_{1}+2(\sqrt{2}+1)nP_{2}^{2}-P_{2}P_{1}^{2} \in {\mathcal{H}}_{4}^{[n]}\). For the input line containing \(n:=n\), the coefficients of \(f_{1}\), and \((r,s):=(r,s)\), running the first part of QE4 gives \(A=r(n+r)(n-r)\) (≥0), and so (1) holds for \(f_{1}\). Table 7 describes a way of checking conditions (26)r.

Table 7 Checking conditions (26)r for the first inequality from Example 11

By Theorem 8 we conclude that \(\mathrm{QE}(f_{1})\) holds.

Second inequality (the best of the form \(M_{4}-M_{1}^{4}\ge \lambda (M_{3}M_{1}-M_{2}^{2})\), with \(\lambda >0\)). Let \(f_{2}=n^{3}P_{4}-2(\sqrt{3}+1)n^{2}P_{3}P_{1}+2(\sqrt{3}+1)n^{2}P_{2}^{2}-P_{1}^{4} \in {\mathcal{H}}_{4}^{[n]}\). For the input line containing \(n:=n\), the coefficients of \(f_{2}\), and \((r,s):=(r,s)\), running the first part of QE4 gives \(A=r(n-r)(n^{2}+nr+r^{2})\) (≥0), and so (1) holds for \(f_{2}\). Table 8 describes a way of checking conditions (26)r.

Table 8 Checking conditions (26)r for the second inequality from Example 11

By Theorem 8 we conclude that \(\mathrm{QE}(f_{2})\) holds.

Third inequality (the best of the form \(M_{4}-M_{2}M_{1}^{2}\ge \lambda (M_{3}M_{1}-M_{1}^{4})\), with \(\lambda >0\)). Let \(f_{3}=n^{3}P_{4}-2(\sqrt{2}-1)n^{2}P_{3}P_{1}-nP_{2}P_{1}^{2}+2( \sqrt{2}-1)P_{1}^{4}\in {\mathcal{H}}_{4}^{[n]}\). For the input line containing \(n:=n\), the coefficients of \(f_{3}\), and \((r,s):=(r,s)\), running the first part of QE4 gives \(A=r(n+r)(n-r)(n+2r-2\sqrt{2} r)\) (≥0), and so (1) holds for \(f_{3}\). For the input change \(n:=r+s\), running again the first part of QE4 gives \(G,H\ge 0=K\). By Theorem 8 we conclude that \(\mathrm{QE}(f_{3})\) holds.

Fourth inequality (the best of the form \(M_{4}-M_{1}^{4}\ge \lambda (M_{3}M_{1}-M_{2}M_{1}^{2})\), with \(\lambda >0\)). Let \(f_{4}=n^{3}P_{4}-2\sqrt{2} n^{2}P_{3}P_{1}+2\sqrt{2} nP_{2}P_{1}^{2}-P_{1}^{4} \in {\mathcal{H}}_{4}^{[n]}\). For the input line containing \(n:=n\), the coefficients of \(f_{4}\), and \((r,s):=(r,s)\), running the first part of QE4 gives \(A=r(n-r)(n^{2}+nr+r^{2}-2\sqrt{2} nr)\) (≥0), and so (1) holds for \(f_{4}\). Table 9 describes a way of checking conditions (26)r.

Table 9 Checking conditions (26)r for the fourth inequality from Example 11

By Theorem 8 we conclude that \(\mathrm{QE}(f_{4})\) holds. □

Example 12

On \(\mathbb{R}^{n}\) we have the inequality

$$ (M_{3}-M_{2}M_{1})^{2}\le \bigl(M_{4}-M_{2}^{2}\bigr) \bigl(M_{2}-M_{1}^{2}\bigr). $$

Proof

Let \(\xi \in \mathbb{R}^{n}\setminus M_{1}^{-1}(\{0\})\) and \(m_{k}:=M_{k}(\xi )\) for every \(k\in \overline{1,4}\). The inequality will follow if we show that \(g(\lambda ):=(m_{4}-m_{2}^{2})\lambda ^{2}-2m_{1}(m_{3}-m_{2}m_{1}) \lambda +m_{1}^{2}(m_{2}-m_{1}^{2})\) has no sign change for \(\lambda \in \mathbb{R}\), since \(m_{1}\ne 0\). Let us define

$$ f_{\lambda }=\lambda ^{2}n^{3}P_{4}-2 \lambda n^{2}P_{3}P_{1}-\lambda ^{2}n^{2}P_{2}^{2}+(2 \lambda +1)nP_{2}P_{1}^{2}-P_{1}^{4} \in {\mathcal{H}}_{4}^{[n]}\quad ( \lambda \in \mathbb{R}). $$

It is easily seen that \(f_{\lambda }(\xi )=n^{4}g(\lambda )\). For the input line containing \(n:=n\), the coefficients of \(f_{\lambda }\), and \((r,s):=(r,s)\), running the first part of QE4 gives

$$ A=r(n-r) (n\lambda -r)^{2},\qquad G=16n^{4}r^{4}(n-r)^{4}(2 \lambda -1)^{4}(n \lambda -r)^{4},\qquad H=K=0. $$

Since \(A_{r},G_{r},H_{r},K_{r}\ge 0\) for every r, by Theorem 8 we conclude that \(\mathrm{QE}(f_{\lambda })\) holds. It follows that \(g(\lambda )=n^{-4}f_{\lambda }(\xi )\ge 0\) for every \(\lambda \in \mathbb{R}\), and hence that

$$ 4m_{1}^{2}\bigl[(m_{3}-m_{2}m_{1})^{2}- \bigl(m_{4}-m_{2}^{2}\bigr) \bigl(m_{2}-m_{1}^{2}\bigr)\bigr]= \Delta _{g}\le 0. $$

We thus have proved the claimed inequality on \(\mathbb{R}^{n}\setminus M_{1}^{-1}(\{0\})\), which is dense in \(\mathbb{R}^{n}\). Therefore, the inequality extends by continuity to \(\mathbb{R}^{n}\). □

Remark 9

Inequalities as in Examples 912 yield corresponding inequalities for the expected values of random variables on a probability space \((\Omega ,\mathcal{F},P)\). For instance, let us show that

$$ E\bigl(X^{4}\bigr)+3E\bigl(X^{2} \bigr)^{2}\ge 4E\bigl(X^{3}\bigr)E(X) \quad \mbox{for every }X \in \mathrm{L}^{3}(\Omega ,\mathbb{R}).$$
(29)

Proof

In order to prove the above inequality, let us first observe that

$$ \sum_{i=1}^{n}p_{i}x_{i}^{4}+3 \Biggl(\sum_{i=1}^{n}p_{i}x_{i}^{2} \Biggr)^{2}\ge 4\sum_{i=1}^{n}p_{i}x_{i}^{3} \cdot \sum_{i=1}^{n}p_{i}x_{i}\quad \mbox{for every }x\in \mathbb{R}^{n},$$
(30)

where \(p_{1},\dots ,p_{n}\in [0,1]\) and \(\sum_{i=1}^{n}p_{i}=1\). Indeed, if \(p_{i}\in \mathbb{Q}\) for every \(i\in \overline{1,n}\), then \(p_{i}=\frac{r_{i}}{r}\) for some \(r,r_{1},\dots ,r_{n}\in \mathbb{N}\), such that \(\sum_{i=1}^{n}r_{i}=r>0\). In this case we have \(\sum_{i=1}^{n}p_{i}x_{i}^{k}=M_{k}(\tilde{x})\) for every \(k\in \mathbb{N}^{*}\), where \(\tilde{x}:=(x_{1}\cdot \mathbf{1}_{r_{1}},\dots ,x_{n}\cdot \mathbf{1}_{r_{n}})\in \mathbb{R}^{r}\). By the first inequality from Example 9 it follows that (30) holds if all \(p_{i}\) are rational. As \(\mathbb{Q}\) is dense in \(\mathbb{R}\), we conclude that (30) also holds for \(p_{1},\dots ,p_{n}\in [0,1]\) such that \(\sum_{i=1}^{n}p_{i}=1\). According to the definition of the abstract integral, it suffices to prove (29) for simple functionsFootnote 8\(X_{0}=\sum_{i=1}^{n}x_{i}\chi _{{\Omega _{i}}}\), where \(x_{1},\dots ,x_{n}\in \mathbb{R}\) and the \(\Omega _{i}\in \mathcal{F}\) are pairwise disjoint, with \(\bigcup_{i=1}^{n}\Omega _{i}=\Omega \). We see that \(E(X_{0}^{k})=\sum_{i=1}^{n}p_{i}x_{i}^{k}\), where \(p_{i}:=P(\Omega _{i})\in [0,1]\) for every \(i\in \overline{1,n}\) and \(\sum_{i=1}^{n}p_{i}=1\). By (30) it follows that (29) holds for every simple function \(X_{0}\), and hence for every \(X\in \mathrm{L}^{3}(\Omega ,\mathbb{R})\). □

Representation in other standard bases

Since a given quartic is often expressed in the monomial symmetric polynomials or in the elementary symmetric polynomials, we next indicate in either case how to find the coefficients from (2) in order to use the algorithms. Assume

$$ f=\alpha M_{4,0,0,0}+\beta M_{3,1,0,0}+\gamma M_{2,2,0,0}+\delta M_{2,1,1,0}+ \varepsilon M_{1,1,1,1}\quad ( \alpha ,\beta ,\gamma ,\delta , \varepsilon \in \mathbb{R}),$$
(31)

where each \(M_{p,q,r,s}\in \mathbb{R}[x_{1},\dots ,x_{n}]\) is the sum of all distinct monomials \(x_{i}^{p}x_{j}^{q}x_{k}^{r}x_{l}^{s}\), with distinct \(i,j,k,l\in \overline{1,n}\). An easy computation shows that switching between representations (31) and (2) may be done by using the equality

$$ \begin{pmatrix} a \\ b \\ c \\ d \\ e\end{pmatrix}= \begin{pmatrix} 1&-1&-\frac{1}{2}&1&-\frac{1}{4} \\ 0&1&0&-1&\frac{1}{3} \\ 0&0&\frac{1}{2}&-\frac{1}{2}&\frac{1}{8} \\ 0&0&0&\frac{1}{2}&-\frac{1}{4} \\ 0&0&0&0&\frac{1}{24} \end{pmatrix} \cdot \begin{pmatrix} \alpha \\ \beta \\ \gamma \\ \delta \\ \varepsilon \end{pmatrix}. $$

If f is given as an expression in the elementary symmetric polynomials \(e_{1},\dots ,e_{4}\)

$$ f=\alpha e_{4}+\beta e_{3}e_{1}+ \gamma e_{2}^{2}+\delta e_{2}e_{1}^{2}+ \varepsilon e_{1}^{4}\quad (\alpha ,\beta ,\gamma ,\delta , \varepsilon \in \mathbb{R}),$$
(32)

then switching between (32) and (2) may be done by using the equality

$$ \begin{pmatrix} a \\ b \\ c \\ d \\ e\end{pmatrix}= \begin{pmatrix} -\frac{1}{4}&0&0&0&0 \\ \frac{1}{3}&\frac{1}{3}&0&0&0 \\ \frac{1}{8}&0&\frac{1}{4}&0&0 \\ -\frac{1}{4}&-\frac{1}{2}&-\frac{1}{2}&-\frac{1}{2}&0 \\ \frac{1}{24}&\frac{1}{6}&\frac{1}{4}&\frac{1}{2}&1 \end{pmatrix} \cdot \begin{pmatrix} \alpha \\ \beta \\ \gamma \\ \delta \\ \varepsilon \end{pmatrix}. $$

Thus both algorithms QE4+ and QE4 may be slightly modified in order to accept as input the coefficients α, β, γ, δ, ε from (31) or from (32).

Availability of data and materials

Not applicable.

Notes

  1. 1.

    This possibility makes the algorithms QE4+ and QE4 much more interesting and useful.

  2. 2.

    With Maple 15 on a Dell Inspiron 5570 with 16GB RAM and Windows 10 OS.

  3. 3.

    Such algorithms are known (see [1, Ch. 14]), but their structure is not relevant here.

  4. 4.

    For instance, \(P_{r,s}\) is a sum of 292 monomials in a, b, c, d, e, r, s.

  5. 5.

    In Maple the 1-D Math input for \(n^{2}-3n+2\) is n^\(2-3*n+2\).

  6. 6.

    The same statement applies whenever we present such tables.

  7. 7.

    To visualize \(Q(x)\), we may run the first part of QE4 with input \(n:=r+s\) and \((r,s):=(x,1)\).

  8. 8.

    By a slight abuse we identify functions and a.e.-equality equivalence classes.

References

  1. 1.

    Basu, S., Pollack, R., Roy, M.-F.: Algorithms in Real Algebraic Geometry, 2nd edn. Algorithms and Computation in Mathematics, vol. 10. Springer, Berlin (2006)

    Book  Google Scholar 

  2. 2.

    Bochnak, J., Coste, M., Roy, M.-F.: Géométrie algébrique réele. Springer, Berlin (1987) (French)

    MATH  Google Scholar 

  3. 3.

    Brown, C.W., Davenport, J.H.: The complexity of quantifier elimination and cylindrical algebraic decomposition. In: ISSAC 2007, pp. 54–60. ACM, New York (2007)

    Google Scholar 

  4. 4.

    Choi, M.D., Lam, T.Y., Reznick, B.: Even symmetric sextics. Math. Z. 195, 559–580 (1987)

    MathSciNet  Article  Google Scholar 

  5. 5.

    Mitrinović, D.S., Pečarić, J.E., Fink, A.M.: Classical and New Inequalities in Analysis. Mathematics and Its Applications (East European Series). Kluwer Academic, Dordrecht (1993)

    Book  Google Scholar 

  6. 6.

    Powers, V., Reznick, B.: Notes towards a constructive proof of Hilbert’s theorem on ternary quartics. Contemp. Math. 272, 209–227 (2000)

    MathSciNet  Article  Google Scholar 

  7. 7.

    Timofte, V.: On the positivity of symmetric polynomial functions. Part I: general results. J. Math. Anal. Appl. 284, 174–190 (2003)

    MathSciNet  Article  Google Scholar 

  8. 8.

    Timofte, V.: On the positivity of symmetric polynomial functions. Part II: lattice general results and positivity criteria for degrees 4 and 5. J. Math. Anal. Appl. 304, 652–667 (2005)

    MathSciNet  Article  Google Scholar 

  9. 9.

    Timofte, V.: On the positivity of symmetric polynomial functions. Part III: extremal polynomials of degree 4. J. Math. Anal. Appl. 307, 565–578 (2005)

    MathSciNet  Article  Google Scholar 

Download references

Acknowledgements

Not applicable.

Funding

Not applicable.

Author information

Affiliations

Authors

Contributions

All authors contributed equally to this research. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Vlad Timofte.

Ethics declarations

Competing interests

The authors declare that they have no competing interests.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Timofte, V., Timofte, A. On algorithms testing positivity of real symmetric polynomials. J Inequal Appl 2021, 135 (2021). https://doi.org/10.1186/s13660-021-02672-1

Download citation

MSC

  • 03C10
  • 14Q15
  • 68W30

Keywords

  • Quantifier elimination
  • Algorithm
  • Symmetric polynomial