We can verify it as follows.
(* Clear all the variables, this often comes handy*)
ClearAll["Global`*"];
(*construct the conditions*)
conditions = x > 0 && y > 0;
(*check wheather the AM-GM inequality holds for all x,y satisfying conditions*)
(*Create the AM GM inequality*)
inequalityAMGM =
ForAll[{x, y},
conditions, (x + y)/2 >=
Sqrt[x y]]
(*Verify if the inequality holds for all x,y satisfying conditions*)
Resolve[inequalityAMGM]
where we get the output True
, so we have verified the AM-GM inequality.
The Cauchy inequality probably one of the most famous inequalities. Let us verify it in Mathematica
for dimension 3.
(* Clear all the variables *)
ClearAll["Global`*"];
(* Create the Cauchy inequality *)
ineqCauchy = ForAll[{x, y}, Element[x | y, Vectors[3, Reals]],
Abs[x . y] <= Norm[x]*Norm[y]];
(* Verify if the inequality holds *)
Resolve[ineqCauchy]
which outputs True
again. We can run this for larger dimension too. However, keep in mind that larger the dimension, longer it would take for Mathematica
to verify it. Hence, it is best if this verification process is kept confined to a smaller dimension, and then if the verification process yields True
, then go for the good old pen and paper to prove it formally.
As our final example, we consider verifying an inequality that shows up in the performance estimation problem, for more details about this problem, please see the paper by Taylor et al. here. We want to verify an identity that shows up in Theorem 4 of the mentioned paper. Given vectors we want to show that the following two terms and are equal to each other. We have:
and
Where .
First we clear the variables.
(*Clear all the variables*)
ClearAll["Global`*"];
We are going to do this test for . Let us create our assumptions.
n = 3;
myAssumptions = (xi | xj | gi | gj) \[Element]
Vectors[n, Reals] && (\[Mu] | L) \[Element] Reals && \[Mu] > 0 &&
L > 0 && \[Mu] < L
Let us construct first.
t1 = fi - fj -
gj.(xi - xj) - (-((2 \[Mu] (-gi + gj).(-xi + xj))/L) +
Norm[gi - gj]^2/L + \[Mu] Norm[xi - xj]^2)/(2 (1 - \[Mu]/L))
Now, let us construct by constructing and .
si = \[Mu]/(L - \[Mu]) Dot[gi,
xi] - (\[Mu] L)/(2 (L - \[Mu])) Norm[xi]^2 -
1/(2 (L - \[Mu])) Norm[gi]^2 + fi;
sj = \[Mu]/(L - \[Mu]) Dot[gj,
xj] - (\[Mu] L)/(2 (L - \[Mu])) Norm[xj]^2 -
1/(2 (L - \[Mu])) Norm[gj]^2 + fj;
pij = Dot[
gj - \[Mu] xj, (L/(L - \[Mu]) xi -
1/(L - \[Mu]) gi) - (L/(L - \[Mu]) xj - 1/(L - \[Mu]) gj)];
t2 = si - sj - pij
Construct the identity now.
identityPEP = ForAll[{gi, gj, xi, xj, \[Mu], L}, myAssumptions, t1== t2]
Time to resolve.
Resolve[identityPEP]
This yields True
(it will take a few minutes) so the identity in question is true for .