2

I try (in Mathematica 10)

FullSimplify[l >= l1 + l2, {l <= l1 + l2, Element[l | l1 | l2, Integers]}]

But that gives back

l >= l1 + l2

Whereas I expected

l == l1 + l2

However, (as stated in the comments)

FullSimplify[l >= l1 + l2 && l <= l1 + l2]

yields

l == l1 + l2

Superficially these two variants (inequality as assumption, or as equation) look equivalent. What is the technical difference between the two?

To counter the claim that my question is easily answered with the documentation or that it is a simple mistake, the documentation for FullSimplify reads

Assumptions can consist of equations, inequalities, domain specifications such as x[Element]Integers, and logical combinations of these.

which led me to believe my initial attempt should be equivalent to the solution given in the comments.

jeinarsson
  • 121
  • 2
  • 1
    FullSimplify[l >= l1 + l2 && l <= l1 + l2] – ciao Jun 23 '16 at 09:16
  • 2
    Not even full...Simplify[l>=l1+l2&&l<=l1+l2] – Ymareth Jun 23 '16 at 09:18
  • 1
    Or Reduce[{l >= l1 + l2, l <= l1 + l2}, l]... – ciao Jun 23 '16 at 09:23
  • Welcome! I suggest the following:
    1. As you receive help, try to give it too, by answering questions in your area of expertise.
    2. Take the tour and check the faqs!
    3. When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
    –  Jun 23 '16 at 09:26
  • Thanks, I refined the question to understand the nuance between my attempt and your solution. I don't think it's a "simple mistake", because according to the documentation Simplify accepts inequalities as assumptions. To me it is then unexpected behavior that these two are different. – jeinarsson Jun 27 '16 at 07:10
  • 1
    The technical difference is that l == l1 + l2 is simpler than l >= l1 + l2 && l <= l1 + l2 but not simpler than l >= l1 + l2 (as measured by Simplify`SimplifyCount[expr]). Note: a SimplifyCount function is given in the docs for ComplexityFunction. See also (26172). – Michael E2 Jun 27 '16 at 14:25
  • 1
    Another reason is that there does not seem to be a transformation in the default TransformationFunctions that will transform l >= l1 + l2. under the assumption l <= l1 + l2. (AFAIR, I couldn't find one a couple of days ago. I should have though ciao's first comment would be tried internally. Maybe it is, but a custom ComplexityFunction that prefers == to >= didn't work.) – Michael E2 Jun 27 '16 at 14:39

1 Answers1

2

Try this:

Reduce[l >= l1 + l2 && l <= l1 + l2 && 
  Element[l | l1 | l2, Integers], l]

(*  (C[1] | C[2]) ∈ Integers && l1 == C[1] && l2 == C[2] && 
 l == C[1] + C[2]   *)
MikeY
  • 7,153
  • 18
  • 27
Alexei Boulbitch
  • 39,397
  • 2
  • 47
  • 96