Re: Assume() similar to Maple?
- To: mathgroup at smc.vnet.net
- Subject: [mg6846] Re: [mg6799] Assume() similar to Maple?
- From: jpk at max.mpae.gwdg.de
- Date: Thu, 24 Apr 1997 02:44:27 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
> In a program I am writing using MMA3.0, the function Max[] is used
> extensively. Is there any way to tell MMA that
>
> a>1;
> s>0;
>
> Such that
>
> Max[s, s*a]
>
> would return
>
> a*s
>
Hi Hossein
here is the solution
At first define:
In[1]:=
Unprotect[Max];
Max[a_,b_.a_/; b>=1]:= b*a
Protect[Max];
It works with numbers as b
In[2]:= Max[a,3a]
Out[2]= 3 a
Now lets give the symbol b the property b>1 with:
In[3]:= b /:b>=1 :=True;
and
In[4]= Max[a,b*a]
Out[6]= a b
works.
Hope that helps
Jens