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.
Assuming[x>0,TrueQ[x>0]]

should, as I understand it, test TrueQ[x>0] after assuming x>0. Could someone explain the output False to me, please?

share|improve this question
1  
Related discussion: mathematica.stackexchange.com/questions/601/… –  Leonid Shifrin Mar 26 '12 at 23:31
add comment

1 Answer

up vote 15 down vote accepted

Because the assumption system is not called during the standard evaluation sequence, it is only called when Simplify, FullSimplify, Sum, Integrate etc... are used.
Thus, x>0 remains unevaluated:

Assuming[x > 0, x > 0] 
(*
==> x > 0
*)

and TrueQ then returns False:

Assuming[x > 0, TrueQ[x > 0]]
(*
==> False
*)

If, however, you run Simplify before TrueQ, you get the expected result

Assuming[x > 0, TrueQ[Simplify[x > 0]]]    
(*
==> True
*)

As an aside, there is some "hidden" functionality in the Assumptions` context that lets you perform various checks and calculations within the assumption system. Run ?Assumptions`* to see what's available. You code, in particular, could be written as

Assuming[x > 0, Assumptions`APositive[x - 0]]
(*
==> True
*)
share|improve this answer
    
I should probably emphasis that TrueQ is a syntactic test that "yields True if its argument is True, and yields False otherwise." –  Simon Mar 26 '12 at 23:05
    
Thanks for pointing out the Assumptions context. –  telefunkenvf14 Aug 21 '12 at 23:14
add comment

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.