       Re: Why doesn't TrueQ return True here?

• To: mathgroup at smc.vnet.net
• Subject: [mg119764] Re: Why doesn't TrueQ return True here?
• From: Jacare Omoplata <walkeystalkey at gmail.com>
• Date: Tue, 21 Jun 2011 05:52:10 -0400 (EDT)
• References: <itnd1n\$7h2\$1@smc.vnet.net> <itoljh\$eqh\$1@smc.vnet.net>

```OK, now that I'm reading what I've posted yesterday, it makes no
sense, I guess because I was practically dozing in my chair when I
wrote that. Of course, Mathematica gave Abs[t1-t2] as the answer
because it didn't know which one was greater. When it had the
information that t2>t1, it evaluated Abs[t1-t2] and returned t2-t1 .

On Jun 20, 7:37 pm, Jacare Omoplata <walkeystal... at gmail.com> wrote:
> Thanks for the answers. I'll use Simplify in the future. I also
> learned that TrueQ is just used to force a True or False answer out.
> It gives True when the answer is explicitly true, and gives False in
> all other instances. I guess this is useful in programming.
>
> So, if I wanted Mathematica to work on t1 and t2 like real numbers I
> should use "\$Assumptions = Element[{t1,t2},Reals]" ?
>
> It does SOMETHING, according to the following output, because Out,
> where I've used t1 and t2, is different from Out, where I've used
> the undeclared variables s1 and s2.
>
> But it still doesn't give t2-t1 as the answer, but gives Abs[t1-t2]
> instead. But I get t2-t1 as the answer in Out and Out, where I
> have declared that t2>t1 beforehand.
>
> -----------output-below-------------
>
> In:= \$Assumptions = Element[{t1, t2}, Reals]
>
> Out= (t1 | t2) \[Element] Reals
>
> In:= FullSimplify[Sqrt[(t2 - t1)^2]]
>
> Out= Abs[t1 - t2]
>
> In:= FullSimplify[Sqrt[(s2 - s1)^2]]
>
> Out= Sqrt[(s1 - s2)^2]
>
> In:= \$Assumptions = t2 > t1
>
> Out= t2 > t1
>
> In:= FullSimplify[Sqrt[(t2 - t1)^2]]
>
> Out= -t1 + t2
>
> In:= FullSimplify[Sqrt[(t1 - t2)^2]]
>
> Out= -t1 + t2
>
> In:= \$Assumptions = Element[{t1, t2}, Complexes]
>
> Out= (t1 | t2) \[Element] Complexes
>
> In:= FullSimplify[Sqrt[(t2 - t1)^2]]
>
> Out= Sqrt[(t1 - t2)^2]
>
> In:= FullSimplify[Sqrt[(s2 - s1)^2]]
>
> Out= Sqrt[(s1 - s2)^2]
>
> On Jun 20, 8:05 am, Bob Hanlon <hanl... at cox.net> wrote:
>
>
>
>
>
>
>
> > ??\$Assumptions
>
> > \$Assumptions is the default setting for the Assumptions option used in =
such functions as Simplify, Refine and Integrate.  >>
>
> > \$Assumptions=True
>
> > TrueQ is not one of the functions that makes use of \$Assumptions.
>
> > \$Assumptions = t2 > t1;
>
> > Simplify[(t2 - t1) > 0]
>
> > True
>
> > TrueQ[Simplify[(t2 - t1) > 0]]
>
> > True
>
> > Bob Hanlon
>
> > ---- Jacare Omoplata <walkeystal... at gmail.com> wrote:
>
> > =============
> > Here's the output.
> > -------------------------------------------------------
> > In:= Element[{t1, t2}, Reals]
>
> > Out= (t1 | t2) \[Element] Reals
>
> > In:= \$Assumptions = t2 > t1
>
> > Out= t2 > t1
>
> > In:= TrueQ[(t2 - t1) > 0]
>
> > Out= False
> > ------------------------------------------------------
>
> > I would expect TrueQ to return True, not False. Why does it return Fals=
e?
>
> > And how can I test whether t2-t1 is positive?
>
> > Thanks.

```

• Prev by Date: Re: Why doesn't TrueQ return True here?
• Next by Date: Re: Multiple use of Set on lists
• Previous by thread: Re: Why doesn't TrueQ return True here?
• Next by thread: Why can't FullSimplify give more uniform output?