Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Question summary: I would like to learn some tips and tricks on how to prove inequalities with Mathematica.

I'm studying various inequalities in triangle that have the form $R+ar + bs\geq 0$, where $R$ is a circumcircle radius, $r$ is an incircle radius and $s$ is a semiperimeter of a triangle.

ClearAll[R, r, s, isTriangle];
R[x_, y_, z_] := (
 x y z)/Sqrt[(x + y - z) (x - y + z) (-x + y + z) (x + y + z)];
r[x_, y_, z_] := 
  1/2 Sqrt[((x + y - z) (x - y + z) (-x + y + z))/(x + y + z)];
s[x_, y_, z_] := (x + y + z)/2;
isTriangle := 1 >= x > 0 && 1 >= y > 0 && x + y > 1;

I normalize the longest side $z=1$ to simplify the calculation. isTriangle is a condition that there is a triangle with sides $1,x,y$.

I want to prove the following inequalities: $s-3\sqrt{3}r\geq0$ and $-\frac s2+(-2+3\sqrt{3}/2)r+R\geq 0$ for all triangles.

I can easily check that both inequalities are true with the following code:

FindMinimum[{s[1, x, y] - 3 Sqrt[3] r[1, x, y], isTriangle}, {x, y}]

(returns {1.26714*10^-6, {x -> 0.998875, y -> 0.998875}}), i.e. the minimum is $0$);

Resolve[ForAll[{x, y}, isTriangle, 
  s[1, x, y] - 3 Sqrt[3] r[1, x, y] >= 0]]
(* True *)

(checks that inequality holds for all triangles);

FindMinimum[{-s[1, x, y]/2 + (-2 + 3 Sqrt[3]/2) r[1, x, y] + 
   R[1, x, y], isTriangle}, {x, y}]

(returns {9.01882*10^-7, {x -> 0.996601, y -> 0.996601}}, i.e. the minimum is $0$);

Resolve[ForAll[{x, y}, 
  isTriangle, -s[1, x, y]/2 + (-2 + 3 Sqrt[3]/2) r[1, x, y] + 
    R[1, x, y] >= 0]]
(* True *)

(checks that inequality holds for all triangles, but takes some time).

However, I want to find a way to prove them, e.g. so that a human who doesn't trust Mathematica can check that they are always true. I would appreciate some general tips and tricks; e.g. it may be possible to find proves for these particular examples, but I would like to know some (heuristic) methods that could work for some other inequalities, too.

Thanks you very much for your time!

share|improve this question
3  
    
Wow, that was quick! I downloaded Analytica package from here: andrej.com/analytica and noticed that it was written in 1997 for Mathematica 2.0 and never updated since. I'll try to run it but do you by any chance know if it was developed recently? –  Victor K. Jun 12 '12 at 5:07
1  
I know there was an Analytica 2 for Mathematica v5. Not much, but .. –  belisarius Jun 12 '12 at 5:08
1  
If you write a post, you can use a block of code by indenting 4 spaces. This looks far better and magically you get syntax-highlighting for free. I edited your post. –  halirutan Jun 12 '12 at 5:41
1  
@Victor if you see formatting in a post that you don't know how to do, you can click edit and view the raw text for that very post. –  Mr.Wizard Jun 12 '12 at 19:44

1 Answer 1

up vote 3 down vote accepted

Yes, Mathematica can prove these inequalities symbolically. To be more precise, it can Reduce them to True. Generating human-readable proofs is also possible but that's one broad topic.

First, we'll use a “coordinate change”. Notice that your expressions for R, s, r are all symmetric in x, y, z. This hints that we might benefit from using symmetric polynomials of x, y, z instead of x, y, z themselves.

In[1]:= symPolysTable =
        Thread@Rule[
          SymmetricPolynomial[#, {x, y, z}] & /@ Range@3
        , {\[Alpha], \[Beta], \[Gamma]}]
Out[1]= {x + y + z -> \[Alpha], x y + x z + y z -> \[Beta], x y z -> \[Gamma]}

The only not-so-symmetric expression encountered here is (x + y - z) (x - y + z) (-x + y + z). Let's rewrite it in terms of α, β, γ:

In[2]:= balancedSidesPoly = 
        Part[SymmetricReduction[(x + y - z) (x - y + z) (-x + y + z)
             , {x, y, z}
             , {\[Alpha], \[Beta], \[Gamma]}]
        , 1]
Out[2]= -\[Alpha]^3 + 4 \[Alpha] \[Beta] - 8 \[Gamma]

(Part 2 of the expression is “remainder”. It is zero, because polynomial is symmetric, so we ignore it.)

Check out R, r, s rewritten in terms of greek coordinates:

In[3]:= rules =
        { R -> \[Gamma]/Sqrt[balancedSidesPoly \[Alpha]]
        , r -> 1/2 Sqrt[balancedSidesPoly/\[Alpha]]
        , s -> \[Alpha]/2 }
Out[3]= (…)

We shall need these coordinate change rules later, to change statements written in latin coordinates to their “greek” analogues.

Now let's gather facts about triangle in greek form:

In[4]:= sidesArePositive = And[\[Alpha] > 0, \[Beta] > 0, \[Gamma] > 0];

You may check that this is indeed equivalent to And[x > 0, y > 0, z > 0]:

In[5]:= Reduce[sidesArePositive /. Reverse /@ symPolysTable]
Out[5]= z > 0 && y > 0 && x > 0

In[6]:= Reduce[# > 0 & /@ (SymmetricPolynomial[#, {x, y, z}] & /@ Range@3)]
Out[6]= z > 0 && y > 0 && x > 0

The triangle inequalities for sides are probably represented by the statement

In[7]:= sidesAreBalanced = balancedSidesPoly > 0
Out[7]= -\[Alpha]^3 + 4 \[Alpha] \[Beta] - 8 \[Gamma] > 0

(It is obviously neccessary for triangle existence but I haven't checked if it is sufficient as well.)

The last fact that we shall need is

In[8]:= sidesAreReal = 
        Discriminant[
          Collect[(\[Sigma] - x) (\[Sigma] - y) (\[Sigma] - z), \[Sigma]] /.
          {-x - y - z -> -\[Alpha], x y + x z + y z -> \[Beta], x y z -> \[Gamma]}
        , \[Sigma]] >= 0
Out[8]= \[Alpha]^2 \[Beta]^2 - 4 \[Beta]^3 - 4 \[Alpha]^3 \[Gamma] + 18 \[Alpha] \[Beta] \[Gamma] - 27 \[Gamma]^2 >= 0

The polynomial in σ is cubic with real roots. Hence, its discriminant must be nonnegative.

Gather all the facts in one statement:

In[9]:= allFacts = And[sidesArePositive, sidesAreBalanced, sidesAreReal]
Out[9]= \[Alpha] > 0 && \[Beta] > 0 && \[Gamma] > 0 &&
        -\[Alpha]^3 + 4 \[Alpha] \[Beta] - 8 \[Gamma] > 0 &&
        \[Alpha]^2 \[Beta]^2 - 4 \[Beta]^3 - 4 \[Alpha]^3 \[Gamma] + 18 \[Alpha] \[Beta] \[Gamma] - 27 \[Gamma]^2 >= 0

This polynomial reducer will transform arbitrary latin statements to greek ones:

In[10]:= toGreekCoordinates[expr_, knownFacts_] :=
         Refine[expr /. rules // Simplify // Reduce, knownFacts]

Check out the Euler inequality:

In[12]:= toGreekCoordinates[R >= 2 r, allFacts]
Out[12]= True

Assuming only that sides are positive wouldn't suffice:

In[13]:= toGreekCoordinates[R >= 2 r, sidesArePositive]
Out[13]= (\[Alpha]^3 + 8 \[Gamma])/(4 \[Alpha]) < \[Beta] <= (\[Alpha]^3 + 9 \[Gamma])/(4 \[Alpha])

Now, your inequalities can be reduced with allFacts:

In[14]:= toGreekCoordinates[3 Sqrt[3] r <= s, allFacts]
Out[14]= True

In[15]:= toGreekCoordinates[3 Sqrt[3] r + 2 R >= s + 4 r, allFacts]
Out[15]= True
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.