2
$\begingroup$

I am trying to simplify some expressions using assumptions and got an inconsistent behavior of Mathematica 9 when working with indexed variables. Consider

Assuming[Subscript[x,_] ∈ Reals, Refine[Im[Subscript[x, 10]]]]

0

Assuming[Subscript[x,_] ∈ Reals && Subscript[x,_] > 0, Refine[Sign[Subscript[x,10]]]]
Sign[Subscript[x, 10]]
Assuming[Subscript[x,10] > 0, Refine[Sign[Subscript[x,10]]]]

1

It appears that assumptions about an indexed variable being real work, but assumptions about the positivity of an indexed variable seem not to work.

$\endgroup$
2
  • $\begingroup$ Have you tried Assuming[x \[Element] Reals, Refine[Im[x]]] Assuming[x \[Element] Reals && x > 0, Refine[Sign[x]]] Assuming[x > 0, Refine[Sign[x]]]? $\endgroup$ Commented Sep 11, 2013 at 16:36
  • 1
    $\begingroup$ This works as expected. My problem is that assumptions on patterns can only work for domains. $\endgroup$
    – yarchik
    Commented Sep 12, 2013 at 8:41

1 Answer 1

2
$\begingroup$

It is not Assuming that supports general patterns, but Element. This explains why

Assuming[x > 0, Refine@Sign[x]]

gives 1, while

Assuming[x[_] > 0, Refine@Sign[ x[1] ]]

does not.

$\endgroup$
2
  • 1
    $\begingroup$ Just a note: seems like Element only supports patterns with domains such as Reals, not regions such as Interval. Not directly relevant to this question, but in case someone finds this later on... $\endgroup$
    – Chris K
    Commented Apr 11, 2019 at 15:43
  • $\begingroup$ @ChrisK That's not obvious at all, but reading under Details on the Element doc page makes it clear why it's so. $\endgroup$
    – Szabolcs
    Commented Apr 11, 2019 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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