       Re: How to assume that a function is positive?

• To: mathgroup at smc.vnet.net
• Subject: [mg114358] Re: How to assume that a function is positive?
• From: Leonid Shifrin <lshifr at gmail.com>
• Date: Thu, 2 Dec 2010 05:38:27 -0500 (EST)

```Hi ADL,

There is not much to explain in this particular case. If you use Trace, you
can see that your assumption evaluates to True before simplification takes
place, and thus gives no information to Simplify - due to the UpValues you
have defined. B.t.w., using Unevaluated will not help here either.

Regards,
Leonid

On Wed, Dec 1, 2010 at 10:12 AM, ADL <alberto.dilullo at tiscali.it> wrote:

> On 30 Nov, 10:04, Sam Takoy <sam.ta... at yahoo.com> wrote:
> > Hi,
> >
> > Who do I let Mathematica know that a function f is positive for all
> > arguments? For example, how do I make the following work (I think my
> > intention is clear):
> >
> > Assuming[f[x] > 0, (f[x + y]^2)^(1/2) // Simplify]
> >
> > Many thanks in advance,
> >
> > Sam
>
> This fact is even more puzzling after observing the following results:
>
> Clear[f];
>
> Simplify[Sqrt[f[x]^2], f[x] > 0]
> Out[]= f[x]
>
> Simplify[Sqrt[f[x]^2],  !f[x] < 0]
> Out[]= f[x]
>
>
> f/:f[_]>0=True;
>
> Simplify[Sqrt[f[x]^2], f[x]>0]
> Out[]= Sqrt[f[x] ^2]
>
>
> f/:f[_]<0=False;
>
> Simplify[Sqrt[f[x]^2],  !f[x] < 0]
> Out[]= Sqrt[f[x] ^2]
>
>
> In other terms, not only any way to impose the positivity of f appears
> to fail, but it also *breaks* Mathematica (8) capability to perform
> the simplifications!
>
> Can anyone explain this behavior?
>