# An inequality concerning Lagrange's identity

we know Lagrange's identity $$(a^2_{1}+a^2_{2}+a^2_{3})(b^2_{1}+b^2_{2}+b^2_{3})=(a_{1}b_{1}+a_{2}b_{2}+a_{3}b_{3})^2+\sum_{i=1}^{2}\sum_{j=i+1}^{3}(a_{i}b_{j}-a_{j}b_{i})^2$$

then we have Cauchy-Schwarz inequality $$(a^2_{1}+a^2_{2}+a^2_{3})(b^2_{1}+b^2_{2}+b^2_{3})\ge (a_{1}b_{1}+a_{2}b_{2}+a_{3}b_{3})^2$$

However, does the following inequality still hold $$(a^2_{1}+b^2_{2}+b^2_{3})(a^2_{2}+b^2_{3}+b^2_{1})(a^2_{3}+b^2_{1}+b^2_{2})\ge (b^2_{1}+b^2_{2}+b^2_{3})(a_{1}b_{1}+a_{2}b_{2}+a_{3}b_{3})^2$$ $$+\dfrac{1}{2}(b_{1}a_{2}b_{3}-b_{1}b_{2}a_{3})^2+\dfrac{1}{2}(b_{1}b_{2}a_{3}-a_{1}b_{2}b_{3})^2+\dfrac{1}{2}(a_{1}b_{2}b_{3}-b_{1}a_{2}b_{3})^2\tag{*}$$

for $a_{i},b_{i}\in \mathbb R,i=1,2,3$?

• Can you explain how this inequality arises? – Iosif Pinelis May 29 '16 at 14:21

Without loss of generality, all the $a_i$'s and $b_i$'s are nonzero. Let $\tilde d$ denote the difference between the left- and right-hand sides of the conjectured inequality $(*)$, which then of course can be rewritten as $\tilde d\ge0$. In the previous version of my answer, I rewrote $\tilde d$ in new variables, $x_i$ and $y_i$, after which the inequality $\tilde d\ge0$ could be (rigorously) verified with Mathematica (in about 22 min).

Here that expression for $\tilde d$ is further rewritten -- in new, "more-macro", variables -- so that the resulting expression can be rather easily analyzed, to prove the inequality $(*)$. Indeed, let $p_i:=(x_i-y_i)y_i$, $x_i:=a_1 a_2 a_3/a_i$, $y_i:=b_1 b_2 b_3/b_i$, $$c_1:=p_2^2 + p_2 p_3 + p_3^2\ge0,\quad c_2:=p_1^2 + p_1 p_3 + p_3^2\ge0,\quad c_3:=p_2^2 + p_2 p_1 + p_1^2\ge0, \tag{0}$$ and $z_i:=y_i^2\ge0$. Note that $x_1 x_2 x_3=(a_1 a_2 a_3)^2>0$ and $y_1 y_2 y_3=(b_1 b_2 b_3)^2>0$; moreover, $$(p_1+z_1)(p_2+z_2)(p_3+z_3)\ge0. \tag{1}$$ The crucial identity is
$$\tilde d\,y_1 y_2 y_3=d:= p_1 p_2 p_3+c_1 z_1+c_2 z_2+c_3 z_3.$$ Since $y_1 y_2 y_3>0$, $\tilde d$ equals $d$ in sign. So, it suffices to show that $d\ge0$ -- for any real $p_i$'s, the $c_i$'s as in $(0)$, and any nonnegative $z_i$'s satisfying $(1)$. Note here that without loss of generality $p_1 p_2 p_3<0$ -- otherwise, $d\ge0$ immediately follows because the $c_i$'s and $z_i$'s are nonnegative. So, we may assume that the $p_i$'s are are all nonzero and hence the $c_i$'s are all strictly positive.

Take any nonzero real $p_i$'s and any nonnegative $z_i$'s such that $(1)$ holds. Let us then fix those $z_1$ and $z_2$, and let $z_3$ be decreasing as long as $z_3$ remains nonnegative and $(1)$ holds; clearly, this process can stop only when the value of $z_3$ becomes either $0$ or $-p_3$, and in the latter case we must have $-p_3>0$. Moreover, since $c_i>0$ for all $i$, the value of $d$ will not increase after this process is complete.

We can then proceed similarly by decreasing $z_2$ (instead of $z_3$), and then by decreasing $z_1$.

Let now $(z_1,z_2,z_3)$ be any minimizer of $d$. Then it follows from the above reasoning that $z_i\in\{0,-p_i\}$ for each $i=1,2,3$; moreover, if at that $z_i=-p_i$ for some $i$, then we must have $-p_i>0$. So, by the symmetry with respect to permutations of the indices, it is enough to consider the following four cases:

(i) $z_1=-p_1>0$, $z_2=-p_2>0$, $z_3=-p_3>0$;

(ii) $z_1=-p_1>0$, $z_2=-p_2>0$, $z_3=0$;

(iii) $z_1=-p_1>0$, $z_2=0$, $z_3=0$;

(iv) $z_1=0$, $z_2=0$, $z_3=0$, so that $(1)$ becomes $p_1 p_2 p_3\ge0$.

In case (i), $\min_{z_1,z_2,z_3}d=-(p_1 + p_2) (p_1 + p_3) (p_2 + p_3)>0$.

In case (ii), $\min_{z_1,z_2,z_3}d=-p_1 p_2 (p_1 + p_2) - p_1 p_2 p_3 + (-p_1 - p_2) p_3^2$, which is a convex quadratic polynomial in $p_3$, with discriminant $-p_1 p_2 (4 p_1^2 + 7 p_1 p_2 + 4 p_2^2)<0$, whence again $\min_{z_1,z_2,z_3}d>0$.

In case (iii), $\min_{z_1,z_2,z_3}d=-p_1 (p_2^2 + p_3^2)>0$.

In case (iv), $\min_{z_1,z_2,z_3}d=p_1 p_2 p_3\ge0$.

Thus, $\min_{z_1,z_2,z_3}d\ge0$ in all cases, and the inequality in question is proved.

• I have replaced the proof with Mathematica by a short one without it. – Iosif Pinelis May 29 '16 at 5:56
• @losif Pinelis,can you post it your short one proof?Thanks – function sug May 30 '16 at 1:53
• @functionsug : The above proof is what I referred to as the short one. It certainly appears so in comparison with the previous proof, with Mathematica, which was hidden somewhere in Mathematica's innards and apparently very, very long (perhaps hundreds or thousands of pages), as it took Mathematica about 22 min to produce it, on a computer with a 3.5 GHz CPU). – Iosif Pinelis May 30 '16 at 2:33

I tried hard to find counterexample but failed after 2 days' running of SageMath's program as below.

However two rules could be oberserved:

1. for any given k > 0, there are many solutions satisfy (left - right) / right < k
2. when left = right,

either ai = bi for i = 1,2,3

or ai = bj = bk = 0 and i+j+k = 6

It seems the inequality is right. But I don't have ability to prove it.

#### a conjecture on MO ####

import time,random

for j in xrange(10000000001):

if j % 1000000 == 0:
print 'j reach ',j, time.ctime()
v =  200 # max
a1 = random.randint(0, v)   #  can be modified to Real
a2 = random.randint(0, v)
a3 = random.randint(0, v)
b1 = random.randint(0, v)
b2 = random.randint(0, v)
b3 = random.randint(0, v)
a21  = a1^2
b22 =  b2^2
b23 =  b3^2
a22  = a2^2
b21 =  b1^2
a23  = a3^2
C = (a21+b22+b23)*(a22+b23+b21)*(a23+b21+b22)
D = (b21+b22+b23)*(a1*b1+a2*b2+a3*b3)^2+(b1*a2*b3-b1*b2*a3)^2/2+(b1*b2*a3-a1*b2*b3)^2/2+(a1*b2*b3-b1*a2*b3)^2/2
if C < D:
print a1,a2,a3,b1,b2,b3,'counterexample!'
break
if C > D and (C-D)/C < 0.000001: print C,D,1.0*(C-D)/C,'for', a1,a2,a3,b1,b2,b3
if C == D: print 'C=D for ', a1,a2,a3,b1,b2,b3,'should 3 pairs equal or three 0 in a special order'


print 'done'

• I'm no Sage expert but did you look at sage.numerical.optimize.minimize with the function being the LHS minus the RHS. – yberman May 26 '16 at 18:18
• @YBerman Thanks for advise. After testing minimize(), I found it has limitation though it is a good tool, for example "Warning: Desired error not necessarily achieved due to precision loss." Based on the minimize(), if no warning arise, it always give the same result C = D. – goodboy May 27 '16 at 1:29
• @goodboy, yup I tested it in Octave and had the same result. – yberman May 27 '16 at 2:23

This is a comment, not the answer. However it is too long as a comment.

Lagrange's identity follows from the properties of quaternions, namely that they constitute a composition algebra. Let $q_1=a_1i+a_2j+a_3k$ and $q_2=b_1i+b_2j+b_3k$ be two imaginary quaternions. Then $q_1q_2=-\vec{A}\cdot\vec{B}+(\vec{A}\times\vec{B})_1i+(\vec{A}\times\vec{B})_2j+(\vec{A}\times\vec{B})_4k$, where $\vec{A}=(a_1,a_2,a_3)$ and $\vec{B}=(b_1,b_2,b_3)$. Lagrange's identity follows from the composition property of the quaternionic norm $|q_1q_2|=|q_1||q_2|$: $$\vec{A}^2\vec{B}^2=(\vec{A}\cdot\vec{B})^2+(\vec{A}\times\vec{B})^2.$$ Let us try to generalize Lagrange's identity by introducing third imaginary quaternion $q_3=c_1i+c_2j+c_3k$. Then $$q_1q_2q_3=-(\vec{A}\times\vec{B})\cdot\vec{C}+W_1i+W_2j+W_3k,$$ where $\vec{C}=(c_1,c_2,c_3)$ and $$\vec{W}=-\vec{A}\cdot\vec{B}\,\vec{C}+(\vec{A}\times\vec{B})\times\vec{C}=-\vec{A}\cdot\vec{B}\,\vec{C}-\vec{B}\cdot\vec{C}\,\vec{A}+\vec{C}\cdot\vec{A}\,\vec{B}.$$ Therefore it follows from $|q_1q_2q_3|=|q_1||q_2||q_3|$ that $$\vec{A}^2\vec{B}^2\vec{C}^2=[(\vec{A}\times\vec{B})\cdot\vec{C}]^2+$$ $$(\vec{A}\cdot\vec{B})^2\,\vec{C}^2+(\vec{B}\cdot\vec{C})^2\,\vec{A}^2+(\vec{C}\cdot\vec{A})^2\,\vec{B}^2-2(\vec{A}\cdot\vec{B})\,(\vec{B}\cdot\vec{C})\,(\vec{C}\cdot\vec{A}),$$ which can be represented also in the form $$\vec{A}^2\vec{B}^2\vec{C}^2=[(\vec{A}\times\vec{B})\times\vec{C}]^2+[(\vec{A}\times\vec{B})\cdot\vec{C}]^2+(\vec{A}\cdot\vec{B})^2\vec{C}^2. \tag{1}$$ Some non-trivial inequalities follow from this generalization of the Lagrange's identity, like $$\vec{A}^2\vec{B}^2\vec{C}^2\ge [(\vec{A}\times\vec{B})\cdot\vec{C}]^2-2(\vec{A}\cdot\vec{B})\,(\vec{B}\cdot\vec{C})\,(\vec{C}\cdot\vec{A}),$$ and $$\vec{A}^2\vec{B}^2\vec{C}^2\ge [(\vec{A}\times\vec{B})\times\vec{C}]^2+[(\vec{A}\times\vec{B})\cdot\vec{C}]^2,$$ however it is not clear how the inequality (*) is related to it (if related at all). Note that (1) simply follows from the Lagrange's identity itself. Therefore the considered generalization is not very profound.

With computer, here is another solution.

Rewrite the inequality as \begin{align} A a_1^2+B a_1+C \ge 0 \end{align} where \begin{align} A &= a_2^2 a_3^2+a_2^2 b_1^2+a_2^2 b_2^2+a_3^2 b_1^2+a_3^2 b_3^2, \\ B &= -2 a_2 b_1^3 b_2-2 a_2 b_1 b_2^3-a_2 b_1 b_2 b_3^2-2 a_3 b_1^3 b_3-a_3 b_1 b_2^2 b_3-2 a_3 b_1 b_3^3, \\ C &= A_1 a_2^2+B_1 a_2+C_1, \\ A_1 &= a_3^2 b_2^2+a_3^2 b_3^2, \\ B_1 &= -a_3 b_1^2 b_2 b_3-2 a_3 b_2^3 b_3-2 a_3 b_2 b_3^3, \\ C_1 &= b_1^4 b_2^2+b_1^4 b_3^2+b_1^2 b_2^4+2 b_1^2 b_2^2 b_3^2+b_1^2 b_3^4+b_2^4 b_3^2+b_2^2 b_3^4. \end{align} Clearly, $$A_1, C_1 \ge 0$$. Note that $$4A_1C_1 - B_1^2 = a_3^2 b_1^2 (4 b_1^2 b_2^4+7 b_1^2 b_2^2 b_3^2+4 b_1^2 b_3^4+4 b_2^6+8 b_2^4 b_3^2+8 b_2^2 b_3^4+4 b_3^6)\ge 0$$. Thus, $$C \ge 0$$. Clearly $$A \ge 0$$. Thus, it suffices to prove that $$4AC - B^2 \ge 0$$. It is true since it can be expressed as SOS (Sum of Squares) given by ($$Q_i, \ \forall i$$ is positive semidefinite) $$4AC - B^2 = \frac{1}{1500}\Big(z_1^TQ_1z_1 + z_2^TQ_2z_2 + z_3^TQ_3z_3 + z_4^TQ_4z_4 + z_5^TQ_5z_5 + z_6^TQ_6z_6\Big)$$ where \begin{align} z_1 = \left(\begin{array}{c} a_2 a_3 b_2^2 b_3\\ a_2^2 a_3^2 b_2 \end{array}\right), \quad z_2 = \left(\begin{array}{c} a_3 b_1 b_2 b_3^2\\ a_2 b_1 b_2^2 b_3\\ a_2 b_1^3 b_3\\ a_2 a_3^2 b_1 b_3\\ a_2^2 a_3 b_1 b_2\\ a_3 b_1^3 b_2 \end{array}\right), \quad z_3 = \left(\begin{array}{c} a_2 b_1 b_2 b_3^2\\ a_3 b_1 b_2^2 b_3\\ a_2 a_3^2 b_1 b_2\\ a_2^2 a_3 b_1 b_3 \end{array}\right),\quad z_4 = \left(\begin{array}{c} a_2 b_2^3 b_3\\ a_2^2 a_3 b_2^2\\ a_2 b_1^2 b_2 b_3\\ a_3 b_1^2 b_2^2\\ a_3 b_2^2 b_3^2\\ a_2 a_3^2 b_2 b_3 \end{array}\right), \end{align} \begin{align} z_5 = \left(\begin{array}{c} a_2 a_3 b_2 b_3^2\\ a_2^2 a_3^2 b_3 \end{array}\right), \quad z_6 = \left(\begin{array}{c} a_2 b_2^2 b_3^2\\ a_2^2 a_3 b_2 b_3\\ a_2 b_1^2 b_3^2\\ a_3 b_1^2 b_2 b_3\\ a_3 b_2 b_3^3\\ a_2 a_3^2 b_3^2 \end{array}\right), \end{align} \begin{align} Q_1 = \left(\begin{array}{cc} 6000 & -6000\\ -6000 & 6000 \end{array}\right), \quad Q_2 = \left(\begin{array}{cccccc} 6000 & -800 & -3000 & -6000 & 800 & 3000\\ -800 & 6000 & 3000 & 800 & -6000 & -3000\\ -3000 & 3000 & 6000 & 3000 & -3000 & -6000\\ -6000 & 800 & 3000 & 6000 & -800 & -3000\\ 800 & -6000 & -3000 & -800 & 6000 & 3000\\ 3000 & -3000 & -6000 & -3000 & 3000 & 6000 \end{array}\right), \end{align} \begin{align} Q_3 = \left(\begin{array}{cccc} 7942 & -4138 & 917 & -4721\\ -4138 & 7934 & -4717 & 921\\ 917 & -4717 & 6000 & -2200\\ -4721 & 921 & -2200 & 6000 \end{array}\right), \quad Q_4 = \left(\begin{array}{cccccc} 6000 & -6000 & 3000 & -3000 & 0 & 0\\ -6000 & 6000 & -3000 & 3000 & 0 & 0\\ 3000 & -3000 & 6000 & -6000 & -1283 & 1283\\ -3000 & 3000 & -6000 & 6000 & 1283 & -1283\\ 0 & 0 & -1283 & 1283 & 6000 & -6000\\ 0 & 0 & 1283 & -1283 & -6000 & 6000 \end{array}\right), \end{align} \begin{align} Q_5 = \left(\begin{array}{cc} 6000 & -6000\\ -6000 & 6000 \end{array}\right), \quad Q_6 = \left(\begin{array}{cccccc} 6000 & -6000 & 1279 & -1279 & 0 & 0\\ -6000 & 6000 & -1279 & 1279 & 0 & 0\\ 1279 & -1279 & 6000 & -6000 & -3000 & 3000\\ -1279 & 1279 & -6000 & 6000 & 3000 & -3000\\ 0 & 0 & -3000 & 3000 & 6000 & -6000\\ 0 & 0 & 3000 & -3000 & -6000 & 6000 \end{array}\right). \end{align}

• I suppose you find the SOS expression via a computer algebra system. Would you please show your code for this decomposition? – Hans Nov 14 '19 at 10:48
• @Hans I do not have universal code. It is in general difficult to find rational SOS. Often you can find real SOS by SOS solvers. Based on this, sometimes you need to adjust the real coefficients to rational. However, I don't know the universal method to do this. – River Li Nov 14 '19 at 12:14
• I see. But would you mind showing the specific, not universal, code for the SOS for this particular problem? – Hans Nov 14 '19 at 18:04
• @Hans For this particular problem, I first found real SOS (by SOS solvers), e.g., $f = z^TQz$ where $Q$ is not rational. Then I tried to multiply $Q$ by some integers. I found that $1500Q$ is almost integer matrix (taking roundoff error into account). Fortunately, it is. For SOS solvers, you may see e.g., ocw.mit.edu/courses/electrical-engineering-and-computer-science/… – River Li Nov 15 '19 at 1:06
• You are welcome. There are some SOS solvers. Another one: yalmip.github.io/tutorial/sumofsquaresprogramming – River Li Nov 16 '19 at 0:41