I am using
Limit with the option
Analytic->True to check the finiteness of some expressions with generic functions and I use
$Assumptions to supply some general assumptions about the variables involved. While calculating the limit of some diverent expressions, I see Messages of the type
Series::cas which involve assumptions, that I did not specify.
I've managed to boil down the expression to the following (divergent) example:
$Assumptions=Element[x,Reals]&&0<x<1&&Element[ep,Reals]&&-1/1000<ep<0; foo=x^(-1-ep)*(j[x]*nn[x,0]^(2-2*ep) +(nn[0,0]^(2-2*ep)-nn[0,y]^(2-2*ep) -(ff[x]*nn[x,0]^(2-2*ep))/ff +(ff[x]*nn[x,y]^(2-2*ep))/ff)); Limit[foo,x->0,Analytic->True]
The result is
\[Infinity] j nn[0, 0]^(2 - 2 ep) which is fine, since I expect the expression to be divergent.
The first evaluation of the
Limit command yields the messages
Series::cas: "Warning: contradictory assumption(s) Re[x]>4096&&-(1/4096)<Im[x]<1/4096&&x\[Element]Reals&&0<x<1&&ep\[Element]Reals&&-(1/1000)<ep<0 encountered." Series::cas: "Warning: contradictory assumption(s) Re[x]>4096&&-(1/4096)<Im[x]<1/4096&&x\[Element]Reals&&0<x<1&&ep\[Element]Reals&&-(1/1000)<ep<0 encountered."
What bothers me are the additional assumptions
Re[x]>4096&&-(1/4096)<Im[x]<1/4096 which seem to be added inerternally by
Series (which is at the heart of
Limit if I understand things correctly).
What exacly leads to these messages and how can I avoid them in general?
I know that I can turn off messages using
Quiet or more selectively using
Off. I am more interested in getting to the root cause of this problem since I would like to use code based upon this to automatically detect divergent (sub-)expressions.
I found the somewhat related question Difficulty with computing a limit. However, the answer only addresses how to work around the problem in the specific case of the question.
If I evaluate the command a second time there are no messages. After calling
ClearSystemCache the messages reappar during the next evaluation. I suppose that the results of the call to
Series are being cached.
If I supply the same assumptions to
Limit directly via the option
Assumptions, no messages appear:
ClearSystemCache; $Assumptions=True; Limit[foo,x->0,Analytic->True, Assumptions->Element[x,Reals]&&0<x<1&&Element[ep,Reals]&&-1/1000<ep<0]
Assuming leads to messages, just like when using
Further stripping down the example by removing subexpressions usually gets rid of the messages.
I've encountered this behaviour in Mathematica 18.104.22.168, 22.214.171.124, 10.2.0.0, 126.96.36.199 on Linux x86 (64bit).