The Simplify
command is having trouble verifying a compound inequality, even while it correctly handles the two corresponding single inequalities.
I'm starting with some simple global assumptions:
$Assumptions = Element[k, Integers] && i == k + 1;
Under these assumptions, the following uses of Simplify
all return True
, as expected:
In[2]:= Simplify[i == k + 1]
Out[2]= True
In[3]:= Simplify[k < k + 1 < k + 2]
Out[3]= True
In[4]:= Simplify[k < i && i < k + 2]
Out[4]= True
However, combining the two inequalities from the last input above into one compound inequality does not yield the expected output:
In[5]:= Simplify[k < i < k + 2]
Out[5]= k < i < 2 + k
(*NOT True as expected*)
Why does Simplify
not recognize that this compound inequality is true?
(Note: I realize it seems silly to check if k<i<k+2
since I'm already assuming i=k+1
. However, I was having problems while dealing with more complex code, and this behavior of Simplify
seemed to be at the root of it.)