Re: 2 Assumptions for one parameter?
- To: mathgroup at smc.vnet.net
- Subject: [mg128053] Re: 2 Assumptions for one parameter?
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Wed, 12 Sep 2012 02:58:04 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-newout@smc.vnet.net
- Delivered-to: mathgroup-newsend@smc.vnet.net
On 9/11/12 at 2:32 AM,
=?ISO-8859-1?Q?Andreas_Talmon_l=27Arm=E9e?= at smc.vnet.net wrote:
>What is the right typing to make two assumptions for one parameter?
>Something like this:
>$Assumptions={a>0&&Element[a,Reals]}
either what you have or:
$Assumpitions={a>0, Element[a,Reals]}
but note, by default Mathematica makes a variable as general as
possible. So, since a>0 isn't meaningful for complex a, it follows:
$Assumptions={a>0&&Element[a,Reals]}
$Assumptions={a>0, Element[a,Reals]}
$Assumptions={a>0}
all achieve exactly the same thing.
>And is there a way to to control my assumptions made for the
>parameters I use something like
>?a
It is unclear to me what you are trying to do here. Setting the
value of $Assumptions impacts those functions that look at the
value of $Assumptions when you use them but has no effect on the
value of other symbols such as a. That is you can do:
In[6]:= Clear[a]; $Assumptions = {a > 0};
Simplify@Element[Sqrt[a], Reals]
Out[7]= True
then assign a value to a that contradicts your assumptions and
work with it
In[8]:= a = -2;
Element[Sqrt[a], Reals]
Out[9]= False
but this definitely causes problems for functions that look at
the value of $Assumptions since now
In[10]:= Simplify@Element[Sqrt[a], Reals]
Out[10]= True
and generates an warning stating one or more assumptions
evaluated to False