       Re: Re: Manipulating a complex modulus expression

• To: mathgroup at smc.vnet.net
• Subject: [mg82958] Re: [mg82911] Re: Manipulating a complex modulus expression
• From: danl at wolfram.com
• Date: Mon, 5 Nov 2007 04:57:26 -0500 (EST)
• References: <fgens4\$g36\$1@smc.vnet.net>

>> Each new application of Simplify or FullSimplify is an adventure :-)
>
> Indeed ...  I am curious: if one nests ComplexExpand inside Simplify
> (or FullSimplify) would the simplifier automatically know that all
> (non-designated) variables are real?
>
> If that is so, that would be a form of intraprocess inheritance
> typical of
> some languages.

No, Mathematica does not do that. Not even with explicit assumptions. What
I mean there is if we have, say,

Limit[Simplify[f[x,t],Assumptions->{t>3,x>10^10}],x->Infinity]

then when Limit evaluates, it will not use the assumption that t>3. Which
could matter if f[x,t] was (after simplification) Exp[-t*x].

I'll add that the sort of inheritance you describe strikes me as a bad
idea. It involves a hidden change of state and, moreover, it is not
obvious to me (as I am unfamiliar with languages that might do this)
when/where this change would revert.

In Mathematica, and many other languages, one can attain an explicit
change, with fairly well defined limitations on where it applies and how
it might be used. For example one might do

Assuming[Element[t,Reals], ...]

Now the assumption is in force through the duration of the Assuming
construct (that is, the scope is quite explicit). The applicability is to
all functions called while inside that Assuming block that take an
Assumptions option, provided the option is set to Automatic.

Another approach, a bit less to my liking but perhaps preferable in
certain circumstances, would be

oldAssumptions = \$Assumptions

\$Assumptions = whatever

...

\$Assumptions = oldAssumptions

Now the "whatever" assumptions are in force during execution of anything
in the ... part, for any functions that take \$Assumptions as an option and
have it set to (the default of) Automatic.

With both of these it is not too hard to figure out when the internal
state is altered to contain an assumption, and when that alteration ceases
to be in force.

Daniel Lichtblau
Wolfram Research

• Prev by Date: Re: The uses of Condition (/;)
• Next by Date: Re: The uses of Condition (/;)
• Previous by thread: Re: Re: Manipulating a complex modulus expression
• Next by thread: NDSolve with functions of vectors