Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Why doesn't TrueQ return True here?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119738] Re: Why doesn't TrueQ return True here?
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Mon, 20 Jun 2011 08:03:50 -0400 (EDT)

On 6/19/11 at 7:29 PM, walkeystalkey at gmail.com (Jacare Omoplata)
wrote:

>Here's the output.
>-------------------------------------------------------
>In[29]:=Element[{t1, t2}, Reals]
>Out[29]= (t1 | t2) \[Element] Reals

This does nothing to change the properties of t1,t2 by itself.
Element needs to be used as part of the assumptions to be made
during an evaluation, not separately in an attempt to assign
global properties to variables.

>In[30]:= $Assumptions = t2 > t1
>Out[30]= t2 > t1

>In[31]:= TrueQ[(t2 - t1) > 0]
>Out[31]= False
>------------------------------------------------------

>I would expect TrueQ to return True, not False. Why does it return
>False?

Per the documentation TrueQ only returns True when the
expression being evaluated is *explicitly* true. You are
attempting to define t2-t1>0 by setting assumptions on t1,t2
which will not make t2-t1>0 explicitly true.

>And how can I test whether t2-t1 is positive.

Use Refine, i.e,

In[1]:= Refine[t2 - t1 > 0, t2 > t1]

Out[1]= True

or

In[2]:= $Assumptions = t2 > t1;

In[3]:= Refine[t2 - t1 > 0]

Out[3]= True



  • Prev by Date: Re: Why doesn't TrueQ return True here?
  • Next by Date: Possibilities to speed up export to swf
  • Previous by thread: Re: Why doesn't TrueQ return True here?
  • Next by thread: Re: Why doesn't TrueQ return True here?